Browse Source

Use the new Predis\Autoloader class for tests and examples.

Daniele Alessandri 13 years ago
parent
commit
5e41657363
2 changed files with 6 additions and 15 deletions
  1. 3 7
      examples/SharedConfigurations.php
  2. 3 8
      test/bootstrap.php

+ 3 - 7
examples/SharedConfigurations.php

@@ -1,12 +1,8 @@
 <?php
 
-spl_autoload_register(function($class) {
-    $file = __DIR__.'/../lib/'.strtr($class, '\\', '/').'.php';
-    if (file_exists($file)) {
-        require $file;
-        return true;
-    }
-});
+require __DIR__.'/../lib/Predis/Autoloader.php';
+
+Predis\Autoloader::register();
 
 $single_server = array(
     'host'     => '127.0.0.1',

+ 3 - 8
test/bootstrap.php

@@ -1,12 +1,7 @@
 <?php
 
-spl_autoload_register(function($class)
-{
-    $file = __DIR__.'/../lib/'.strtr($class, '\\', '/').'.php';
-    if (file_exists($file)) {
-        require $file;
-        return true;
-    }
-});
+require __DIR__.'/../lib/Predis/Autoloader.php';
+
+Predis\Autoloader::register();
 
 require __DIR__.'/PredisShared.php';