mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[feature/extension-manager] Add prefix to extension meta data / install classes
PHPBB3-10323
This commit is contained in:
parent
639e3b9f17
commit
f53892c838
6 changed files with 14 additions and 14 deletions
|
@ -106,7 +106,7 @@ class phpbb_extension_manager
|
|||
*/
|
||||
public function get_extension($name)
|
||||
{
|
||||
$extension_class_name = 'phpbb_ext_' . $name;
|
||||
$extension_class_name = 'phpbb_ext_' . $name . '_ext';
|
||||
|
||||
if (class_exists($extension_class_name))
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
class phpbb_ext_bar extends phpbb_extension_base
|
||||
class phpbb_ext_bar_ext extends phpbb_extension_base
|
||||
{
|
||||
static public $state;
|
||||
|
5
tests/extension/ext/foo/ext.php
Normal file
5
tests/extension/ext/foo/ext.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
class phpbb_ext_foo_ext extends phpbb_extension_base
|
||||
{
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
<?php
|
||||
|
||||
class phpbb_ext_foo extends phpbb_extension_base
|
||||
{
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
class phpbb_ext_moo extends phpbb_extension_base
|
||||
class phpbb_ext_moo_ext extends phpbb_extension_base
|
||||
{
|
||||
static public $purged;
|
||||
|
|
@ -8,8 +8,8 @@
|
|||
*/
|
||||
|
||||
require_once dirname(__FILE__) . '/../mock/cache.php';
|
||||
require_once dirname(__FILE__) . '/ext/bar/bar.php';
|
||||
require_once dirname(__FILE__) . '/ext/moo/moo.php';
|
||||
require_once dirname(__FILE__) . '/ext/bar/ext.php';
|
||||
require_once dirname(__FILE__) . '/ext/moo/ext.php';
|
||||
|
||||
class phpbb_extension_manager_test extends phpbb_database_test_case
|
||||
{
|
||||
|
@ -51,14 +51,14 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
|
|||
|
||||
public function test_enable()
|
||||
{
|
||||
phpbb_ext_bar::$state = 0;
|
||||
phpbb_ext_bar_ext::$state = 0;
|
||||
|
||||
$this->assertEquals(array('foo'), array_keys($this->extension_manager->all_enabled()));
|
||||
$this->extension_manager->enable('bar');
|
||||
$this->assertEquals(array('bar', 'foo'), array_keys($this->extension_manager->all_enabled()));
|
||||
$this->assertEquals(array('bar', 'foo', 'moo'), array_keys($this->extension_manager->all_configured()));
|
||||
|
||||
$this->assertEquals(4, phpbb_ext_bar::$state);
|
||||
$this->assertEquals(4, phpbb_ext_bar_ext::$state);
|
||||
}
|
||||
|
||||
public function test_disable()
|
||||
|
@ -71,7 +71,7 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
|
|||
|
||||
public function test_purge()
|
||||
{
|
||||
phpbb_ext_moo::$purged = false;
|
||||
phpbb_ext_moo_ext::$purged = false;
|
||||
|
||||
$this->assertEquals(array('foo'), array_keys($this->extension_manager->all_enabled()));
|
||||
$this->assertEquals(array('foo', 'moo'), array_keys($this->extension_manager->all_configured()));
|
||||
|
@ -79,7 +79,7 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
|
|||
$this->assertEquals(array('foo'), array_keys($this->extension_manager->all_enabled()));
|
||||
$this->assertEquals(array('foo'), array_keys($this->extension_manager->all_configured()));
|
||||
|
||||
$this->assertTrue(phpbb_ext_moo::$purged);
|
||||
$this->assertTrue(phpbb_ext_moo_ext::$purged);
|
||||
}
|
||||
|
||||
public function test_enabled_no_cache()
|
||||
|
|
Loading…
Add table
Reference in a new issue