From: Chuck Hagenbuch Date: Thu, 29 Oct 2009 22:40:16 +0000 (-0400) Subject: Update to use \ as the namespace separator. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=6a7747593bea4719c41b0e3e3b778780b519bde1;p=horde.git Update to use \ as the namespace separator. --- diff --git a/framework/Argv/test/Horde/Argv/AllTests.php b/framework/Argv/test/Horde/Argv/AllTests.php index 7192f5eb9..e8b56f111 100644 --- a/framework/Argv/test/Horde/Argv/AllTests.php +++ b/framework/Argv/test/Horde/Argv/AllTests.php @@ -42,7 +42,7 @@ class Horde_Argv_AllTests { // Set up autoload set_include_path(dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'lib' . PATH_SEPARATOR . get_include_path()); if (!spl_autoload_functions()) { - spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); include "$filename.php";')); + spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'\\\', \'_\'), \'/\', $class); include "$filename.php";')); } // Test base classes and helper objects diff --git a/framework/Autoloader/lib/Horde/Autoloader.php b/framework/Autoloader/lib/Horde/Autoloader.php index 5cc6106c7..00c8ab224 100644 --- a/framework/Autoloader/lib/Horde/Autoloader.php +++ b/framework/Autoloader/lib/Horde/Autoloader.php @@ -45,9 +45,9 @@ class Horde_Autoloader if (strcasecmp($matches[0][0], $class) === 0) { $relativePath = $replace . '/' . $class; } else { - $relativePath = str_replace(array('::', '_'), '/', substr($class, 0, $matches[0][1])) . + $relativePath = str_replace(array('\\', '_'), '/', substr($class, 0, $matches[0][1])) . $replace . - str_replace(array('::', '_'), '/', substr($class, $matches[0][1] + strlen($matches[0][0]))); + str_replace(array('\\', '_'), '/', substr($class, $matches[0][1] + strlen($matches[0][0]))); } if (self::_loadClass($relativePath)) { @@ -57,7 +57,7 @@ class Horde_Autoloader } /* Do a final search in the include path. */ - $relativePath = str_replace(array('::', '_'), '/', $class); + $relativePath = str_replace(array('\\', '_'), '/', $class); return self::_loadClass($relativePath); } @@ -145,7 +145,7 @@ class Horde_Autoloader * Add a new class pattern. * * @param string $pattern The class pattern to add. - * @param string $replace The substitution pattern. All '_' and '::' + * @param string $replace The substitution pattern. All '_' and '\' * strings in a classname will be converted to * directory separators. If the entire pattern * is matched, the matched text will be appended diff --git a/framework/Constraint/test/Horde/Constraint/AllTests.php b/framework/Constraint/test/Horde/Constraint/AllTests.php index 2a785384d..02333c4d5 100644 --- a/framework/Constraint/test/Horde/Constraint/AllTests.php +++ b/framework/Constraint/test/Horde/Constraint/AllTests.php @@ -21,7 +21,7 @@ class Horde_Constraint_AllTests public static function suite() { if (!spl_autoload_functions()) { - spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); include "$filename.php";')); + spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'\\\', \'_\'), \'/\', $class); include "$filename.php";')); } set_include_path(dirname(__FILE__) . '/../../../lib' . PATH_SEPARATOR . get_include_path()); diff --git a/framework/Controller/test/Horde/Controller/AllTests.php b/framework/Controller/test/Horde/Controller/AllTests.php index 0ff186336..a366d50c7 100644 --- a/framework/Controller/test/Horde/Controller/AllTests.php +++ b/framework/Controller/test/Horde/Controller/AllTests.php @@ -39,7 +39,7 @@ class Horde_Controller_AllTests { { set_include_path(dirname(__FILE__) . '/../../../lib' . PATH_SEPARATOR . get_include_path()); if (!spl_autoload_functions()) { - spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); include "$filename.php";')); + spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'\\\', \'_\'), \'/\', $class); include "$filename.php";')); } $suite = new PHPUnit_Framework_TestSuite('Horde Framework - Horde_Controller'); diff --git a/framework/Date/test/Horde/Date/AllTests.php b/framework/Date/test/Horde/Date/AllTests.php index c5a7eea3e..302deaf96 100644 --- a/framework/Date/test/Horde/Date/AllTests.php +++ b/framework/Date/test/Horde/Date/AllTests.php @@ -25,7 +25,7 @@ class Horde_Date_AllTests { { set_include_path(dirname(__FILE__) . '/../../../lib' . PATH_SEPARATOR . get_include_path()); if (!spl_autoload_functions()) { - spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); include "$filename.php";')); + spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'\\\', \'_\'), \'/\', $class); include "$filename.php";')); } $suite = new PHPUnit_Framework_TestSuite('Horde Framework - Horde_Date'); diff --git a/framework/Db/test/Horde/Db/AllTests.php b/framework/Db/test/Horde/Db/AllTests.php index 33a1dc369..2c035baae 100644 --- a/framework/Db/test/Horde/Db/AllTests.php +++ b/framework/Db/test/Horde/Db/AllTests.php @@ -47,7 +47,7 @@ class Horde_Db_AllTests { // Set up include_path and autoloading set_include_path(dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'lib' . PATH_SEPARATOR . get_include_path()); if (!spl_autoload_functions()) { - spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); $er = error_reporting(22525); include "$filename.php"; error_reporting($er);')); + spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'\\\', \'_\'), \'/\', $class); $er = error_reporting(22525); include "$filename.php"; error_reporting($er);')); } // Build the suite diff --git a/framework/Feed/test/Horde/Feed/AllTests.php b/framework/Feed/test/Horde/Feed/AllTests.php index 625cff048..016b6e12d 100644 --- a/framework/Feed/test/Horde/Feed/AllTests.php +++ b/framework/Feed/test/Horde/Feed/AllTests.php @@ -21,7 +21,7 @@ class Horde_Feed_AllTests public static function suite() { if (!spl_autoload_functions()) { - spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); include "$filename.php";')); + spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'\\\', \'_\'), \'/\', $class); include "$filename.php";')); } $suite = new PHPUnit_Framework_TestSuite('Horde Framework - Horde_Feed'); diff --git a/framework/Http/test/Horde/Http/AllTests.php b/framework/Http/test/Horde/Http/AllTests.php index e2aadf5aa..1c18ab856 100644 --- a/framework/Http/test/Horde/Http/AllTests.php +++ b/framework/Http/test/Horde/Http/AllTests.php @@ -25,7 +25,7 @@ class Horde_Http_AllTests { set_include_path(dirname(__FILE__) . '/../../../lib' . PATH_SEPARATOR . get_include_path()); if (!spl_autoload_functions()) { - spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); include "$filename.php";')); + spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'\\\', \'_\'), \'/\', $class); include "$filename.php";')); } $suite = new PHPUnit_Framework_TestSuite('Horde Framework - Horde_Http'); diff --git a/framework/Injector/test/Horde/Injector/AllTests.php b/framework/Injector/test/Horde/Injector/AllTests.php index 666f5076e..5f97f04a1 100644 --- a/framework/Injector/test/Horde/Injector/AllTests.php +++ b/framework/Injector/test/Horde/Injector/AllTests.php @@ -21,7 +21,7 @@ class Horde_Injector_AllTests public static function suite() { if (!spl_autoload_functions()) { - spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); $er = error_reporting(22525); include "$filename.php"; error_reporting($er);')); + spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'\\\', \'_\'), \'/\', $class); $er = error_reporting(22525); include "$filename.php"; error_reporting($er);')); } set_include_path(dirname(__FILE__) . '/../../../lib' . PATH_SEPARATOR . get_include_path()); diff --git a/framework/Log/test/Horde/Log/AllTests.php b/framework/Log/test/Horde/Log/AllTests.php index d7146c2d4..1735d1140 100644 --- a/framework/Log/test/Horde/Log/AllTests.php +++ b/framework/Log/test/Horde/Log/AllTests.php @@ -40,7 +40,7 @@ class Horde_Log_AllTests public static function suite() { if (!spl_autoload_functions()) { - spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); include "$filename.php";')); + spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'\\\', \'_\'), \'/\', $class); include "$filename.php";')); } set_include_path(dirname(__FILE__) . '/../../../lib' . PATH_SEPARATOR . get_include_path()); diff --git a/framework/Pdf/test/Horde/Pdf/AllTests.php b/framework/Pdf/test/Horde/Pdf/AllTests.php index 1e537928a..fd810343d 100644 --- a/framework/Pdf/test/Horde/Pdf/AllTests.php +++ b/framework/Pdf/test/Horde/Pdf/AllTests.php @@ -33,7 +33,7 @@ class Horde_Pdf_AllTests { set_include_path(dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'lib' . PATH_SEPARATOR . get_include_path()); if (!spl_autoload_functions()) { - spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); include "$filename.php";')); + spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'\\\', \'_\'), \'/\', $class); include "$filename.php";')); } $suite = new PHPUnit_Framework_TestSuite('Horde Framework - Horde_Pdf'); diff --git a/framework/Stream_Filter/test/Horde/Stream/Filter/AllTests.php b/framework/Stream_Filter/test/Horde/Stream/Filter/AllTests.php index a48829a17..1094d66ac 100644 --- a/framework/Stream_Filter/test/Horde/Stream/Filter/AllTests.php +++ b/framework/Stream_Filter/test/Horde/Stream/Filter/AllTests.php @@ -33,7 +33,7 @@ class Horde_Stream_Filter_AllTests // Set up autoload set_include_path(dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'lib' . PATH_SEPARATOR . get_include_path()); if (!spl_autoload_functions()) { - spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); include "$filename.php";')); + spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'\\\', \'_\'), \'/\', $class); include "$filename.php";')); } $suite = new PHPUnit_Framework_TestSuite('Horde Framework - Horde_Stream_Filter'); diff --git a/framework/Support/test/Horde/Support/AllTests.php b/framework/Support/test/Horde/Support/AllTests.php index 98f7d660c..5f65318cc 100644 --- a/framework/Support/test/Horde/Support/AllTests.php +++ b/framework/Support/test/Horde/Support/AllTests.php @@ -25,7 +25,7 @@ class Horde_Support_AllTests { { set_include_path(dirname(__FILE__) . '/../../../lib' . PATH_SEPARATOR . get_include_path()); if (!spl_autoload_functions()) { - spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); include "$filename.php";')); + spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'\\\', \'_\'), \'/\', $class); include "$filename.php";')); } $suite = new PHPUnit_Framework_TestSuite('Horde Framework - Horde_Support'); diff --git a/framework/View/test/Horde/View/AllTests.php b/framework/View/test/Horde/View/AllTests.php index eefb6231a..736e067d2 100644 --- a/framework/View/test/Horde/View/AllTests.php +++ b/framework/View/test/Horde/View/AllTests.php @@ -33,7 +33,7 @@ class Horde_View_AllTests { // Set up autoload set_include_path(dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'lib' . PATH_SEPARATOR . get_include_path()); if (!spl_autoload_functions()) { - spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); include "$filename.php";')); + spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'\\\', \'_\'), \'/\', $class); include "$filename.php";')); } // Build the suite diff --git a/framework/Yaml/test/Horde/Yaml/AllTests.php b/framework/Yaml/test/Horde/Yaml/AllTests.php index e42149a19..35fe686ab 100644 --- a/framework/Yaml/test/Horde/Yaml/AllTests.php +++ b/framework/Yaml/test/Horde/Yaml/AllTests.php @@ -36,7 +36,7 @@ class Horde_Yaml_AllTests { // Set up autoload set_include_path(dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'lib' . PATH_SEPARATOR . get_include_path()); if (!spl_autoload_functions()) { - spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); $er = error_reporting(22525); include "$filename.php"; error_reporting($er);')); + spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'\\\', \'_\'), \'/\', $class); $er = error_reporting(22525); include "$filename.php"; error_reporting($er);')); } // Test helpers diff --git a/framework/bin/test_framework b/framework/bin/test_framework index 23fcd4a09..263f4506a 100755 --- a/framework/bin/test_framework +++ b/framework/bin/test_framework @@ -58,7 +58,7 @@ class horde_test_runner $classnames = array($class, $class_notests, $class_horde, $class_horde_notests, $class_pear2, $class_pear2_notests); foreach ($classnames as $classname) { - $classnames[] = str_replace('_', '::', $classname); + $classnames[] = str_replace('_', '\\', $classname); } // Look for something with a ::suite() method.