mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-20 19:02:14 +09:00
Merge pull request #306 from kijin/pr/plugin-blacklist
호환되지 않거나 불필요한 애드온과 모듈의 실행을 방지
This commit is contained in:
commit
4a79b5ce25
8 changed files with 79 additions and 21 deletions
|
|
@ -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
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue