diff options
| author | 2014-12-06 16:17:11 +0100 | |
|---|---|---|
| committer | 2014-12-06 16:17:11 +0100 | |
| commit | 2e4682ebd451f8dd291e11141553add9164cbbef (patch) | |
| tree | 006839fb0363530faf2a31b142dea58af80a2d87 /lib/Minz/ExtensionManager.php | |
| parent | a08c382e0651f22a7db06feba225f3d49289763d (diff) | |
Add enable / disable extension features
See https://github.com/FreshRSS/FreshRSS/issues/252
Diffstat (limited to 'lib/Minz/ExtensionManager.php')
| -rw-r--r-- | lib/Minz/ExtensionManager.php | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/Minz/ExtensionManager.php b/lib/Minz/ExtensionManager.php index 6c32ccf19..46e421bac 100644 --- a/lib/Minz/ExtensionManager.php +++ b/lib/Minz/ExtensionManager.php @@ -160,10 +160,8 @@ class Minz_ExtensionManager { } } - - /** - * Returns a list of extensions. + * Return a list of extensions. * * @param $only_enabled if true returns only the enabled extensions (false by default). * @return an array of extensions. @@ -175,4 +173,18 @@ class Minz_ExtensionManager { return self::$ext_list; } } + + /** + * Return an extension by its name. + * + * @param $ext_name the name of the extension. + * @return the corresponding extension or null if it doesn't exist. + */ + public static function find_extension($ext_name) { + if (!isset(self::$ext_list[$ext_name])) { + return null; + } + + return self::$ext_list[$ext_name]; + } } |
