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


PHP AEPlatform::load_filters方法代码示例

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


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

示例1: __construct

	/**
	 * Public constructor, loads filter data and filter classes
	 */
	public final function __construct()
	{
		static $initializing = false;

		parent::__construct(); // Call parent's constructor

		// Load filter data from platform's database
		AEUtilLogger::WriteLog(_AE_LOG_DEBUG,'Fetching filter data from database');
		$this->filter_registry =& AEPlatform::load_filters();

		// Load platform, plugin and core filters
		$this->filters = array();
		$locations = array(
			AEFactory::getAkeebaRoot().DIRECTORY_SEPARATOR.'platform'.DIRECTORY_SEPARATOR.AKEEBAPLATFORM.DIRECTORY_SEPARATOR.'filters',
			AEFactory::getAkeebaRoot().DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.'filters',
			AEFactory::getAkeebaRoot().DIRECTORY_SEPARATOR.'filters'
		);
		AEUtilLogger::WriteLog(_AE_LOG_DEBUG,'Loading filters');
		foreach($locations as $folder)
		{
			$is_platform = ($folder == AEFactory::getAkeebaRoot().DIRECTORY_SEPARATOR.'platform'.DIRECTORY_SEPARATOR.AKEEBAPLATFORM.DIRECTORY_SEPARATOR.'filters');
			$files = AEUtilScanner::getFiles($folder);
			if($files === false) continue; // Skip inexistent folders
			if(empty($files)) continue; // Skip no-match folders

			// Loop all files
			foreach($files as $file)
			{
				if( substr($file,-4) != '.php' ) continue; // Skip non-PHP files
				$filter_name = ($is_platform ? 'Platform' : '').ucfirst(basename($file,'.php')); // Extract filter base name
				if(array_key_exists($filter_name, $this->filters)) continue; // Skip already loaded filters
				AEUtilLogger::WriteLog(_AE_LOG_DEBUG,'-- Loading filter '.$filter_name);
				$this->filters[$filter_name] =& AEFactory::getFilterObject($filter_name); // Add the filter
			}
		}
		
		// Load platform, plugin and core stacked filters
		$locations = array(
			AEFactory::getAkeebaRoot().DIRECTORY_SEPARATOR.'platform'.DIRECTORY_SEPARATOR.AKEEBAPLATFORM.DIRECTORY_SEPARATOR.'filters'.DIRECTORY_SEPARATOR.'stack',
			AEFactory::getAkeebaRoot().DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.'filters'.DIRECTORY_SEPARATOR.'stack',
			AEFactory::getAkeebaRoot().DIRECTORY_SEPARATOR.'filters'.DIRECTORY_SEPARATOR.'stack'
		);
		$config =& AEFactory::getConfiguration();
		AEUtilLogger::WriteLog(_AE_LOG_DEBUG,'Loading optional filters');
		foreach($locations as $folder)
		{
			$is_platform = ($folder == AEFactory::getAkeebaRoot().DIRECTORY_SEPARATOR.'platform'.DIRECTORY_SEPARATOR.AKEEBAPLATFORM.DIRECTORY_SEPARATOR.'filters'.DIRECTORY_SEPARATOR.'stack');
			$files = AEUtilScanner::getFiles($folder);
			if($files === false) continue; // Skip inexistent folders
			if(empty($files)) continue; // Skip no-match folders

			// Loop all files
			foreach($files as $file)
			{
				if( substr($file,-4) != '.php' ) continue; // Skip non-PHP files
				$bare_name = strtolower(basename($file,'.php'));
				$filter_name = 'Stack'.($is_platform ? 'Platform' : '').ucfirst(basename($file,'.php')); // Extract filter base name
				if(array_key_exists($filter_name, $this->filters)) continue; // Skip already loaded filters
				if( !file_exists( substr($file,0,-4).'.ini' ) ) continue; // Make sure the INI file also exists
				$key = "core.filters.$bare_name.enabled";
				if($config->get($key,0)) {
					AEUtilLogger::WriteLog(_AE_LOG_DEBUG,'-- Loading optional filter '.$filter_name);
					$this->filters[$filter_name] =& AEFactory::getFilterObject($filter_name); // Add the filter
				}
			}
		}
	}
开发者ID:rkern21,项目名称:videoeditor,代码行数:70,代码来源:filters.php


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