當前位置: 首頁>>代碼示例>>PHP>>正文


PHP AEPlatform::configOverrides方法代碼示例

本文整理匯總了PHP中AEPlatform::configOverrides方法的典型用法代碼示例。如果您正苦於以下問題:PHP AEPlatform::configOverrides方法的具體用法?PHP AEPlatform::configOverrides怎麽用?PHP AEPlatform::configOverrides使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在AEPlatform的用法示例。


在下文中一共展示了AEPlatform::configOverrides方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: runBackup

	public function runBackup()
	{
		$ret_array = array();
		
		$ajaxTask = $this->getState('ajax');

		switch($ajaxTask)
		{
			case 'start':
				// Description is passed through a strict filter which removes HTML
				$description = $this->getState('description');
				// The comment is passed through the Safe HTML filter (note: use 2 to force no filtering)
				$comment = $this->getState('comment');
				$jpskey = $this->getState('jpskey');

				$tag = $this->getState('tag');

				// Try resetting the engine
				AECoreKettenrad::reset();

				// Remove any stale memory files left over from the previous step

				if(empty($tag)) $tag = AEPlatform::get_backup_origin();
				AEUtilTempvars::reset($tag);
				
				$kettenrad =& AECoreKettenrad::load($tag);

				// Take care of System Restore Point setup
				if($tag == 'restorepoint') {
					// Fetch the extension's version information
					require_once JPATH_COMPONENT_ADMINISTRATOR.DS.'liveupdate'.DS.'classes'.DS.'xmlslurp.php';
					$slurp = new LiveUpdateXMLSlurp();
					$exttype = $this->getState('type');
					switch($exttype) {
						case 'component':
							$extname = 'com_';
							break;
						case 'module':
							$extname = 'mod_';
							break;
						case 'plugin':
							$extname = 'plg_';
							break;
						case 'template':
							$extname = 'tpl_';
							break;
					}
					$extname .= $this->getState('name');
					$info = $slurp->getInfo($extname, '');
					
					// Get the configOverrides for this extension
					AEPlatform::$configOverrides = $this->getConfigOverridesForSRP($extname, $info);
					
					// Create an SRP descriptor
					$srpdescriptor = array(
						'type'			=> $this->getState('type'),
						'name'			=> $this->getState('name'),
						'group'			=> $this->getState('group'),
						'version'		=> $info['version'],
						'date'			=> $info['date']
					);

					// Set the description and comment
					$description = "System Restore Point - ".JText::_($exttype).": $extname";
					$comment = "---BEGIN SRP---\n".json_encode($srpdescriptor)."\n---END SRP---";
					$jpskey = '';
					
					// Set a custom finalization action queue
					AEPlatform::$configOverrides['volatile.core.finalization.action_handlers'] = array(
						new AEFinalizationSrpquotas()						
					);
					AEPlatform::$configOverrides['volatile.core.finalization.action_queue'] = array(
						'remove_temp_files',
						'update_statistics',
						'update_filesizes',
						'apply_srp_quotas'
					);
				}
				
				$options = array(
					'description'	=> $description,
					'comment'		=> $comment,
					'jpskey'		=> $jpskey
				);
				$kettenrad->setup($options);
				$kettenrad->tick();
				if( ($kettenrad->getState() != 'running') && ($tag == 'restorepoint') ) {
					$kettenrad->tick();
				}
				$ret_array  = $kettenrad->getStatusArray();
				$kettenrad->resetWarnings(); // So as not to have duplicate warnings reports
				AECoreKettenrad::save($tag);
				break;

			case 'step':
				$tag = $this->getState('tag');
				$kettenrad =& AECoreKettenrad::load($tag);
				$kettenrad->tick();
				$ret_array  = $kettenrad->getStatusArray();
				$kettenrad->resetWarnings(); // So as not to have duplicate warnings reports
//.........這裏部分代碼省略.........
開發者ID:rkern21,項目名稱:videoeditor,代碼行數:101,代碼來源:backup.php


注:本文中的AEPlatform::configOverrides方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。