mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-12 19:54:12 +02:00
[ticket/11700] Correctly load extensions with nonprefixed namespaces
PHPBB3-11700
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
class phpbb_ext_bar_ext extends \phpbb\extension\base
|
||||
namespace bar;
|
||||
|
||||
class ext extends \phpbb\extension\base
|
||||
{
|
||||
static public $state;
|
||||
|
||||
|
@@ -1,11 +1,13 @@
|
||||
<?php
|
||||
|
||||
class phpbb_ext_barfoo_acp_a_info
|
||||
namespace barfoo\acp;
|
||||
|
||||
class a_info
|
||||
{
|
||||
public function module()
|
||||
{
|
||||
return array(
|
||||
'filename' => 'phpbb_ext_barfoo_acp_a_module',
|
||||
'filename' => 'barfoo\\acp\\a_module',
|
||||
'title' => 'Barfoo',
|
||||
'version' => '3.1.0-dev',
|
||||
'modes' => array(
|
||||
|
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
class phpbb_ext_barfoo_acp_a_module
|
||||
namespace barfoo\acp;
|
||||
|
||||
class a_module
|
||||
{
|
||||
}
|
||||
|
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
class phpbb_ext_barfoo_ext extends \phpbb\extension\base
|
||||
namespace barfoo;
|
||||
|
||||
class ext extends \phpbb\extension\base
|
||||
{
|
||||
}
|
||||
|
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
class phpbb_ext_foo_a_class
|
||||
namespace foo;
|
||||
|
||||
class a_class
|
||||
{
|
||||
}
|
||||
|
@@ -1,11 +1,13 @@
|
||||
<?php
|
||||
|
||||
class phpbb_ext_foo_acp_a_info
|
||||
namespace foo\acp;
|
||||
|
||||
class a_info
|
||||
{
|
||||
public function module()
|
||||
{
|
||||
return array(
|
||||
'filename' => 'phpbb_ext_foo_acp_a_module',
|
||||
'filename' => 'foo\\acp\\a_module',
|
||||
'title' => 'Foobar',
|
||||
'version' => '3.1.0-dev',
|
||||
'modes' => array(
|
||||
|
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
class phpbb_ext_foo_acp_a_module
|
||||
namespace foo\acp;
|
||||
|
||||
class a_module
|
||||
{
|
||||
}
|
||||
|
@@ -1,9 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace foo\acp;
|
||||
|
||||
/*
|
||||
* Due to the mismatch between the class name and the file name, this module
|
||||
* file shouldn't be found by the extension finder
|
||||
*/
|
||||
class phpbb_ext_foo_acp_foo_info
|
||||
class foo_info
|
||||
{
|
||||
public function module()
|
||||
{
|
||||
|
@@ -1,8 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace foo\acp;
|
||||
|
||||
/*
|
||||
* Due to the mismatch between the class name and the file name of the module
|
||||
* info file, this module's info file shouldn't be found
|
||||
*/
|
||||
class phpbb_ext_foo_acp_fail_module
|
||||
class fail_module
|
||||
{
|
||||
}
|
||||
|
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
class phpbb_ext_foo_b_class
|
||||
namespace foo;
|
||||
|
||||
class b_class
|
||||
{
|
||||
}
|
||||
|
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
class phpbb_ext_foo_ext extends \phpbb\extension\base
|
||||
namespace foo;
|
||||
|
||||
class ext extends \phpbb\extension\base
|
||||
{
|
||||
static public $disabled;
|
||||
|
||||
|
@@ -1,11 +1,13 @@
|
||||
<?php
|
||||
|
||||
class phpbb_ext_foo_mcp_a_info
|
||||
namespace foo\mcp;
|
||||
|
||||
class a_info
|
||||
{
|
||||
public function module()
|
||||
{
|
||||
return array(
|
||||
'filename' => 'phpbb_ext_foo_mcp_a_module',
|
||||
'filename' => 'foo\\mcp\\a_module',
|
||||
'title' => 'Foobar',
|
||||
'version' => '3.1.0-dev',
|
||||
'modes' => array(
|
||||
|
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
class phpbb_ext_foo_mcp_a_module
|
||||
namespace foo\mcp;
|
||||
|
||||
class a_module
|
||||
{
|
||||
}
|
||||
|
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
class phpbb_ext_foo_sub_type_alternative
|
||||
namespace foo\sub\type;
|
||||
|
||||
class alternative
|
||||
{
|
||||
}
|
||||
|
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
class phpbb_ext_foo_type_alternative
|
||||
namespace foo\type;
|
||||
|
||||
class alternative
|
||||
{
|
||||
}
|
||||
|
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
class phpbb_ext_foo_typewrong_error
|
||||
namespace foo\typewrong;
|
||||
|
||||
class error
|
||||
{
|
||||
}
|
||||
|
4
tests/extension/ext/vendor/moo/ext.php
vendored
4
tests/extension/ext/vendor/moo/ext.php
vendored
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
class phpbb_ext_vendor_moo_ext extends \phpbb\extension\base
|
||||
namespace vendor\moo;
|
||||
|
||||
class ext extends \phpbb\extension\base
|
||||
{
|
||||
static public $purged;
|
||||
|
||||
|
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
class phpbb_ext_vendor_moo_feature_class
|
||||
namespace vendor\moo;
|
||||
|
||||
class feature_class
|
||||
{
|
||||
}
|
||||
|
Reference in New Issue
Block a user