本文整理汇总了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
}
}
}
}