<?php
require_once __DIR__ . '/../lib/vendor/Buzz/lib/Buzz/ClassLoader.php';
require_once __DIR__ . '/../lib/vendor/doctrine-common/lib/Doctrine/Common/ClassLoader.php';

// use statements
use Doctrine\Common\ClassLoader;

$loader = new ClassLoader('Doctrine\\Common', __DIR__ . '/../lib/vendor/doctrine-common');
$loader->register();
$loader = new ClassLoader('Doctrine\\Search', __DIR__ . '/../lib');
$loader->register();

Buzz\ClassLoader::register();
<?php
spl_autoload_register(function ($class) {
	
	if ( 0 !== strpos($class, 'Doctrine\\Search')) {
		return false;
	} 
	
	$path = __DIR__ . '/../lib';
	$file = strtr($class, '\\', '/') . '.php';
	$filename = $path . '/' . $file;
	
	if ( file_exists($filename) ) {
		return (Boolean) require_once $filename;
	}
	
	return false;
} );

require_once __DIR__ . '/../lib/vendor/Buzz/lib/Buzz/ClassLoader.php';
Buzz\ClassLoader::register();
--- 
+++ 
@@ -1,20 +1,13 @@
 <?php
-spl_autoload_register(function ($class) {
-	
-	if ( 0 !== strpos($class, 'Doctrine\\Search')) {
-		return false;
-	} 
-	
-	$path = __DIR__ . '/../lib';
-	$file = strtr($class, '\\', '/') . '.php';
-	$filename = $path . '/' . $file;
-	
-	if ( file_exists($filename) ) {
-		return (Boolean) require_once $filename;
-	}
-	
-	return false;
-} );
+require_once __DIR__ . '/../lib/vendor/Buzz/lib/Buzz/ClassLoader.php';
+require_once __DIR__ . '/../lib/vendor/doctrine-common/lib/Doctrine/Common/ClassLoader.php';
 
-require_once __DIR__ . '/../lib/vendor/Buzz/lib/Buzz/ClassLoader.php';
+// use statements
+use Doctrine\Common\ClassLoader;
+
+$loader = new ClassLoader('Doctrine\\Common', __DIR__ . '/../lib/vendor/doctrine-common');
+$loader->register();
+$loader = new ClassLoader('Doctrine\\Search', __DIR__ . '/../lib');
+$loader->register();
+
 Buzz\ClassLoader::register();
Use doctrine classloader instead of closure
