From d297eb4aecc6e658987c9647d76fed4210ef77f5 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 10 Sep 2013 17:13:29 +0200 Subject: [ticket/11700] Get the installer to run with namespaces PHPBB3-11700 --- phpBB/phpbb/db/migration/data/v310/style_update_p2.php | 2 +- phpBB/phpbb/extension/finder.php | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/db/migration/data/v310/style_update_p2.php b/phpBB/phpbb/db/migration/data/v310/style_update_p2.php index 3f6477b7cb..6c3b0de2a1 100644 --- a/phpBB/phpbb/db/migration/data/v310/style_update_p2.php +++ b/phpBB/phpbb/db/migration/data/v310/style_update_p2.php @@ -7,7 +7,7 @@ * */ -namespace phpbb\db\migration\data0; +namespace phpbb\db\migration\data\v310; class style_update_p2 extends \phpbb\db\migration\migration { diff --git a/phpBB/phpbb/extension/finder.php b/phpBB/phpbb/extension/finder.php index 0ecae7a13f..bf84728f05 100644 --- a/phpBB/phpbb/extension/finder.php +++ b/phpBB/phpbb/extension/finder.php @@ -277,9 +277,16 @@ class finder $classes = array(); foreach ($files as $file => $ext_name) { - $file = preg_replace('#^(phpbb|includes)/#', '', $file); - - $classes[] = 'phpbb_' . str_replace('/', '_', substr($file, 0, -strlen('.' . $this->php_ext))); + if (preg_match('#^includes/#', $file)) + { + $file = preg_replace('#^includes/#', '', $file); + $classes[] = 'phpbb_' . str_replace('/', '_', substr($file, 0, -strlen('.' . $this->php_ext))); + } + else + { + $file = preg_replace('#^phpbb/#', '', $file); + $classes[] = 'phpbb\\' . str_replace('/', '\\', substr($file, 0, -strlen('.' . $this->php_ext))); + } } return $classes; } -- cgit v1.2.1