当前位置: 首页>>代码示例>>PHP>>正文


PHP AEPlatform::get_statistics_list方法代码示例

本文整理汇总了PHP中AEPlatform::get_statistics_list方法的典型用法代码示例。如果您正苦于以下问题:PHP AEPlatform::get_statistics_list方法的具体用法?PHP AEPlatform::get_statistics_list怎么用?PHP AEPlatform::get_statistics_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AEPlatform的用法示例。


在下文中一共展示了AEPlatform::get_statistics_list方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: is_excluded_by_api

	protected function is_excluded_by_api($test, $root)
	{
		static $filter_switch;
		static $last_backup;

		if(is_null($filter_switch))
		{
			$config =& AEFactory::getConfiguration();
			$filter_switch = AEUtilScripting::getScriptingParameter('filter.incremental',0);
			$filter_switch = ($filter_switch == 1);

			$last_backup = $config->get('volatile.filter.last_backup', null);
			if(is_null($last_backup) && $filter_switch)
			{
				// Get a list of backups on this profile
				$backups = AEPlatform::get_statistics_list(0, 0, AEPlatform::get_active_profile() );

				// Find this backup's ID
				$model =& AEFactory::getStatistics();
				$id = $model->getId();
				if(is_null($id)) $id = -1;

				// Initialise
				jimport('joomla.utilities.date');
				$last_backup = time();
				$now = $last_backup;

				// Find the last time a successful backup with this profile was made
				if(count($backups)) foreach($backups as $backup)
				{
					// Skip the current backup
					if($backup['id'] == $id) continue;

					// Skip non-complete backups
					if($backup['status'] != 'complete') continue;

					$jdate = new JDate($backup['backupstart']);
					$backuptime = $jdate->toUnix();

					$last_backup = $backuptime;
					break;
				}

				if($last_backup == $now) {
					// No suitable backup found; disable this filter
					$config->set('volatile.scripting.incfile.filter.incremental',0);
					$filter_switch = false;
				} else {
					// Cache the last backup timestamp
					$config->set('volatile.filter.last_backup',$last_backup);
				}
			}
		}

		if(!$filter_switch) return false;

		// Get the filesystem path for $root
		$config =& AEFactory::getConfiguration();
		$fsroot = $config->get('volatile.filesystem.current_root','');
		$ds = ($fsroot == '') || ($fsroot == '/') ? '' : DS;
		$filename = $fsroot.$ds.$test;

		// Get the timestamp of the file
		$timestamp = @filemtime($filename);

		// If we could not get this information, include the file in the archive
		if($timestamp === false) return false;

		// Compare it with the last backup timestamp and exclude if it's older than the last backup
		if($timestamp <= $last_backup) {
			//AEUtilLogger::WriteLog(_AE_LOG_DEBUG, "Excluding $filename due to incremental backup restrictions");
			return true;
		}

		// No match? Just include the file!
		return false;
	}
开发者ID:rkern21,项目名称:videoeditor,代码行数:77,代码来源:incremental.php

示例2: database

	/**
	 * Loads the factory from the storage (if it exists) and returns a reference to the
	 * Kettenrad object.
	 * @param $tag string The backup tag to load
	 * @return AECoreKettenrad A reference to the Kettenrad object
	 */
	public static function &load($tag = null)
	{
		if(is_null($tag) && defined('AKEEBA_BACKUP_ORIGIN')) {
			$tag = AKEEBA_BACKUP_ORIGIN;
		}

		// In order to load anything, we need to have the correct profile loaded. Let's assume
		// that the latest backup record in this tag has the correct profile number set.
		$config =& AEFactory::getConfiguration();
		if( empty($config->activeProfile) )
		{
			// Only bother loading a configuration if none has been already loaded
			$statList = AEPlatform::get_statistics_list(0,1,array(
					array('field' => 'tag', 'value' => $tag)
				),array(
					'by' => 'id', 'order' => 'DESC'	
				)
			);
			if(is_array($statList)) {
				$stat = array_pop($statList);
				$profile = $stat['profile_id'];
				AEPlatform::load_configuration($profile);
			}
		}

		AEUtilLogger::openLog($tag);
		AEUtilLogger::WriteLog(_AE_LOG_DEBUG, "Kettenrad :: Attempting to load from database ($tag)");
		$serialized_factory = AEUtilTempvars::get($tag);
		if($serialized_factory !== false)
		{
			AEUtilLogger::WriteLog(_AE_LOG_DEBUG, " -- Loaded stored Akeeba Factory ($tag)");
			AEFactory::unserialize($serialized_factory);
		}
		else
		{
			// There is no serialized factory. Nuke the in-memory factory.
			AEUtilLogger::WriteLog(_AE_LOG_DEBUG, " -- Stored Akeeba Factory ($tag) not found - hard reset");
			AEFactory::nuke();
			AEPlatform::load_configuration();
		}
		unset($serialized_factory);
		return AEFactory::getKettenrad();
	}
开发者ID:rkern21,项目名称:videoeditor,代码行数:49,代码来源:kettenrad.php

示例3: isLastBackupFailed

	/**
	 * Was the last backup a failed one? Used to apply magic settings as a means of
	 * troubleshooting.
	 *
	 * @return bool
	 */
	public function isLastBackupFailed()
	{
		// Get the last backup record ID
		$list = AEPlatform::get_statistics_list(0,1);
		if(empty($list)) return false;
		$id = $list[0];

		$statmodel->setId($id);
		$record = AEPlatform::get_statistics($id);

		return ($record['status'] == 'fail');
	}
开发者ID:rkern21,项目名称:videoeditor,代码行数:18,代码来源:cpanel.php


注:本文中的AEPlatform::get_statistics_list方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。