本文整理汇总了PHP中AEFactory::getFilterObject方法的典型用法代码示例。如果您正苦于以下问题:PHP AEFactory::getFilterObject方法的具体用法?PHP AEFactory::getFilterObject怎么用?PHP AEFactory::getFilterObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AEFactory
的用法示例。
在下文中一共展示了AEFactory::getFilterObject方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setFilter
/**
* Creates a new regec filter
* @param string $type Filter type
* @param string $root The filter's root
* @param string $string The filter string to remove
* @return bool True on success
*/
public function setFilter($type, $root, $string)
{
$filter = AEFactory::getFilterObject($type);
$success = $filter->set($root, $string);
if ($success) {
$filters = AEFactory::getFilters();
$filters->save();
}
return $success;
}
示例2: setFilter
/**
* Creates a new database definition
* @param string $uuid
* @param array $data
* @return bool
*/
public function setFilter($uuid, $data)
{
$filter = AEFactory::getFilterObject('extradirs');
$success = $filter->set($uuid, $data);
$filters = AEFactory::getFilters();
if ($success) {
$filters->save();
}
return array('success' => $success, 'newstate' => false);
}
示例3: setFilter
/**
* Creates a new database definition
* @param string $root
* @param array $data
* @return bool
*/
public function setFilter($root, $data)
{
$filter = AEFactory::getFilterObject('multidb');
$success = $filter->set($root, $data);
$filters = AEFactory::getFilters();
if ($success) {
$filters->save();
}
return $success;
}
示例4: createPluginFilters
private function createPluginFilters()
{
// Base plugins path
$plugins_path = 'plugins';
// Get all plug-in filters
$filter = AEFactory::getFilterObject('plugins');
$types = $filter->getFilters(null);
if (!empty($types)) {
// Loop all plug-in types
foreach ($types as $type => $items) {
if (!empty($items)) {
// Base path for this plugin type
$base_path = $plugins_path . '/' . $type;
// Loop all plugins of this type and add a directory exclusion
foreach ($items as $item) {
$this->set('[SITEROOT]', $base_path . '/' . $item);
}
}
}
}
}
示例5: resetFilters
/**
* Resets the filters
* @param string $root Root directory
* @return array
*/
public function resetFilters($root)
{
// Get a reference to the global Filters object
$filters = AEFactory::getFilters();
$filter = AEFactory::getFilterObject('directories');
$filter->reset($root);
$filter = AEFactory::getFilterObject('files');
$filter->reset($root);
$filter = AEFactory::getFilterObject('skipdirs');
$filter->reset($root);
$filter = AEFactory::getFilterObject('skipfiles');
$filter->reset($root);
$filters->save();
return $this->make_listing($root);
}
示例6: toggleTemplateFilter
public function toggleTemplateFilter($root, $item)
{
$filter = AEFactory::getFilterObject('templates');
$filter->toggle($root, $item, $newStatus);
$filters = AEFactory::getFilters();
$filters->save();
}
示例7: __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::getInstance()->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
if (in_array(substr($file, 0, 1), array('.', '_'))) {
continue;
}
// Skip filter files starting with dot or dash
$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
}
}
}
}
示例8: reset
/**
* Resets the filters
* @param string $root Root directory
* @return array
*/
public function reset($root)
{
// Get a reference to the global Filters object
$filters =& AEFactory::getFilters();
$filter =& AEFactory::getFilterObject('tables');
$filter->reset($root);
$filter =& AEFactory::getFilterObject('tabledata');
$filter->reset($root);
$filters->save();
return $this->make_listing($root);
}
示例9: __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::getInstance()->load_filters();
// Load platform, plugin and core filters
$this->filters = array();
$locations = array(AEFactory::getAkeebaRoot() . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'filters', AEFactory::getAkeebaRoot() . DIRECTORY_SEPARATOR . 'filters');
$platform_paths = AEPlatform::getInstance()->getPlatformDirectories();
foreach ($platform_paths as $p) {
$locations[] = $p . '/filters';
}
AEUtilLogger::WriteLog(_AE_LOG_DEBUG, 'Loading filters');
foreach ($locations as $folder) {
$is_platform = $this->isPlatformDirectory($folder);
$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
}
if (in_array(substr($file, 0, 1), array('.', '_'))) {
continue;
// Skip filter files starting with dot or dash
}
// Some hosts copy .ini and .php files, renaming them (ie foobar.1.php)
// We need to exclude them, otherwise we'll get a fatal error for declaring the same class twice
$bare_name = strtolower(basename($file, '.php'));
if (preg_match('/[^a-z0-9]/', $bare_name)) {
continue;
}
$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 . 'plugins' . DIRECTORY_SEPARATOR . 'filters' . DIRECTORY_SEPARATOR . 'stack', AEFactory::getAkeebaRoot() . DIRECTORY_SEPARATOR . 'filters' . DIRECTORY_SEPARATOR . 'stack');
$platform_paths = AEPlatform::getInstance()->getPlatformDirectories();
$platform_stack_paths = array();
foreach ($platform_paths as $p) {
$locations[] = $p . '/filters';
$locations[] = $p . '/filters/stack';
$platform_stack_paths[] = $p . '/filters/stack';
}
$config = AEFactory::getConfiguration();
AEUtilLogger::WriteLog(_AE_LOG_DEBUG, 'Loading optional filters');
foreach ($locations as $folder) {
$is_platform = $this->isPlatformDirectory($folder);
$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
// Some hosts copy .ini and .php files, renaming them (ie foobar.1.php)
// We need to exclude them, otherwise we'll get a fatal error for declaring the same class twice
$bare_name = strtolower(basename($file, '.php'));
if (preg_match('/[^a-z0-9]/', $bare_name)) {
continue;
}
$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($folder . '/' . substr($file, 0, -4) . '.ini')) {
continue;
}
//.........这里部分代码省略.........