diff options
| author | Vjacheslav Trushkin <arty@phpbb.com> | 2012-03-29 22:38:07 +0300 |
|---|---|---|
| committer | Vjacheslav Trushkin <arty@phpbb.com> | 2012-03-29 22:38:07 +0300 |
| commit | ba431def5d951ca3df28a1f872d3fa05a9caad54 (patch) | |
| tree | 1425c92d5bc8fda8858ff9a2ab817a26ce901550 /phpBB/includes/extension | |
| parent | d25b607ca16bfd240f3b9cb9da7e4567b426ec26 (diff) | |
| parent | ae824aef1255f7bd4da502fc1d9d0e85219ce32a (diff) | |
| download | forums-ba431def5d951ca3df28a1f872d3fa05a9caad54.tar forums-ba431def5d951ca3df28a1f872d3fa05a9caad54.tar.gz forums-ba431def5d951ca3df28a1f872d3fa05a9caad54.tar.bz2 forums-ba431def5d951ca3df28a1f872d3fa05a9caad54.tar.xz forums-ba431def5d951ca3df28a1f872d3fa05a9caad54.zip | |
Merge remote-tracking branch 'upstream/develop' into feature/merging-style-components
* upstream/develop: (65 commits)
[ticket/10730] Added label tag around "select" text in post splitting UI
[ticket/10732] Add config_dev.php and config_test.php to .gitignore
[ticket/10586] Added space in if statement
[ticket/10586] Tidy up comments
[task/php5.3] Updated range of tested PHP versions
[task/php5.3] Looks like I missed a few places that needed PHP 5.2 changed to PHP 5.3.2
[task/php5.3] Changed minimum PHP requirement for Ascraeus to 5.3.2
[ticket/10723] Stop Travis running all tests on sqlite
[ticket/10703] Added a condition to check if ext directory exists
[task/travis] Refactor php version check for dbunit install
[task/travis] Exclude functional and slow tests
[ticket/10719] Revert "Skip functional tests on PHP 5.2"
[task/travis-develop2] Update version from 5.3 to 5.3.2
[task/travis] Dropping support for 5.2 in develop branch
[task/travis] Some more small travis fixes
[task/travis] Rename travis phpunit config files
[task/travis] Fixing some travis issues
[ticket/10684] Adjust function and parameter name, minor changes.
[task/travis] Add automated testing to readme
[task/travis] Removing development information
...
Conflicts:
phpBB/install/database_update.php
Diffstat (limited to 'phpBB/includes/extension')
| -rw-r--r-- | phpBB/includes/extension/controller_interface.php | 31 | ||||
| -rw-r--r-- | phpBB/includes/extension/manager.php | 26 |
2 files changed, 57 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..537c19aff8 100644 --- a/phpBB/includes/extension/manager.php +++ b/phpBB/includes/extension/manager.php @@ -352,6 +352,10 @@ class phpbb_extension_manager public function all_available() { $available = array(); + if (!is_dir($this->phpbb_root_path . 'ext/')) + { + return $available; + } $iterator = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($this->phpbb_root_path . 'ext/'), @@ -428,6 +432,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 NOTE: Can be user input + * @return bool Depending on whether or not the extension is available + */ + public function available($name) + { + return file_exists($this->get_extension_path($name, true)); + } + + /** + * 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. |
