1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

[ticket/10586] Extension front controller

Handle extension front pages

PHPBB3-10586
This commit is contained in:
David King
2012-02-08 00:08:17 -05:00
parent cfd0afe4ea
commit a0131b45f5
4 changed files with 96 additions and 0 deletions

View File

@@ -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();
}

View File

@@ -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.