Update to use \ as the namespace separator.
authorChuck Hagenbuch <chuck@horde.org>
Thu, 29 Oct 2009 22:40:16 +0000 (18:40 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Fri, 30 Oct 2009 00:11:54 +0000 (20:11 -0400)
16 files changed:
framework/Argv/test/Horde/Argv/AllTests.php
framework/Autoloader/lib/Horde/Autoloader.php
framework/Constraint/test/Horde/Constraint/AllTests.php
framework/Controller/test/Horde/Controller/AllTests.php
framework/Date/test/Horde/Date/AllTests.php
framework/Db/test/Horde/Db/AllTests.php
framework/Feed/test/Horde/Feed/AllTests.php
framework/Http/test/Horde/Http/AllTests.php
framework/Injector/test/Horde/Injector/AllTests.php
framework/Log/test/Horde/Log/AllTests.php
framework/Pdf/test/Horde/Pdf/AllTests.php
framework/Stream_Filter/test/Horde/Stream/Filter/AllTests.php
framework/Support/test/Horde/Support/AllTests.php
framework/View/test/Horde/View/AllTests.php
framework/Yaml/test/Horde/Yaml/AllTests.php
framework/bin/test_framework

index 7192f5e..e8b56f1 100644 (file)
@@ -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
index 5cc6106..00c8ab2 100644 (file)
@@ -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
index 2a78538..02333c4 100644 (file)
@@ -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());
 
index 0ff1863..a366d50 100644 (file)
@@ -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');
index c5a7eea..302deaf 100644 (file)
@@ -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');
index 33a1dc3..2c035ba 100644 (file)
@@ -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
index 625cff0..016b6e1 100644 (file)
@@ -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');
index e2aadf5..1c18ab8 100644 (file)
@@ -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');
index 666f507..5f97f04 100644 (file)
@@ -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());
 
index d7146c2..1735d11 100644 (file)
@@ -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());
 
index 1e53792..fd81034 100644 (file)
@@ -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');
index a48829a..1094d66 100644 (file)
@@ -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');
index 98f7d66..5f65318 100644 (file)
@@ -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');
index eefb623..736e067 100644 (file)
@@ -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
index e42149a..35fe686 100644 (file)
@@ -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
index 23fcd4a..263f450 100755 (executable)
@@ -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.