Initial implementation of blacklist function

This commit is contained in:
Kijin Sung 2016-02-23 21:37:44 +09:00
parent 055fd49e40
commit e335aa477e
2 changed files with 36 additions and 0 deletions

View file

@ -157,6 +157,11 @@ class Context
*/
public $isSuccessInit = TRUE;
/**
* Plugin blacklist cache
*/
private static $_blacklist = null;
/**
* Singleton instance
* @var object
@ -2566,6 +2571,26 @@ class Context
return self::$_instance->allow_rewrite;
}
/**
* Check whether an addon, module, or widget is blacklisted
*
* @param string $plugin_name
* @return bool
*/
public static function isBlacklistedPlugin($plugin_name)
{
if (self::$_blacklist === null)
{
self::$_blacklist = (include RX_BASEDIR . 'common/defaults/blacklist.php');
if (!is_array(self::$_blacklist))
{
self::$_blacklist = array();
}
}
return isset(self::$_blacklist[$plugin_name]);
}
/**
* Converts a local path into an URL
*