diff options
author | David King <imkingdavid@gmail.com> | 2012-02-08 00:08:17 -0500 |
---|---|---|
committer | David King <imkingdavid@gmail.com> | 2012-03-19 09:12:31 -0400 |
commit | a0131b45f56847f7e5c44a6db66cd7359967585f (patch) | |
tree | 49e5bc0079dc0336d84bf7a92c0591ca7c416de3 /phpBB/includes | |
parent | cfd0afe4ead0c4910567d955088d4225d17d4186 (diff) | |
download | forums-a0131b45f56847f7e5c44a6db66cd7359967585f.tar forums-a0131b45f56847f7e5c44a6db66cd7359967585f.tar.gz forums-a0131b45f56847f7e5c44a6db66cd7359967585f.tar.bz2 forums-a0131b45f56847f7e5c44a6db66cd7359967585f.tar.xz forums-a0131b45f56847f7e5c44a6db66cd7359967585f.zip |
[ticket/10586] Extension front controller
Handle extension front pages
PHPBB3-10586
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/extension/controller_interface.php | 31 | ||||
-rw-r--r-- | phpBB/includes/extension/manager.php | 22 |
2 files changed, 53 insertions, 0 deletions
diff --git a/phpBB/includes/extension/controller_interface.php b/phpBB/includes/extension/controller_interface.php new file mode 100644 index 0000000000..bcc8972db4 --- /dev/null +++ b/phpBB/includes/extension/controller_interface.php @@ -0,0 +1,31 @@ +<?php +/** +* +* @package extension +* @copyright (c) 2011 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** +* The interface that extension classes have to implement to run front pages +* +* @package extension +*/ +interface phpbb_extension_controller_interface +{ + /** + * handle the request to display a page from an extension + * + * @return null + */ + public function handle(); +} diff --git a/phpBB/includes/extension/manager.php b/phpBB/includes/extension/manager.php index c38f0df32e..b94379141c 100644 --- a/phpBB/includes/extension/manager.php +++ b/phpBB/includes/extension/manager.php @@ -428,6 +428,28 @@ class phpbb_extension_manager } return $disabled; } + + /** + * Check to see if a given extension is available on the filesystem + * + * @param string $name Extension name to check + * @return bool Depending on whether or not the extension is available + */ + public function available($name) + { + return file_exists($this->phpbb_root_path . "ext/$name/"); + } + + /** + * Check to see if a given extension is enabled + * + * @param string $name Extension name to check + * @return bool Depending on whether or not the extension is enabled + */ + public function enabled($name) + { + return isset($this->extensions[$name]) && $this->extensions[$name]['ext_active']; + } /** * Instantiates a phpbb_extension_finder. |