classes/CodeReview/Autoloader.php
private function registerDirectory($basePath, $prefix = '') {
		$basePath = str_replace('\\', '/', $basePath);
		$basePath = rtrim($basePath, '/') . '/';
		$prefix = ($prefix ? $prefix . '_' : '' );
		$files = scandir($basePath);
		foreach ($files as $file) {
			if ($file[0] == '.') {
				continue;
			}
			$path = $basePath . $file;
			if (is_dir($path)) {
				$this->registerDirectory($path, $prefix . pathinfo($path, PATHINFO_FILENAME));
			} elseif (strtolower(pathinfo($path, PATHINFO_EXTENSION)) == 'php') {
				$name = $prefix . pathinfo($path, PATHINFO_FILENAME);
				$this->classMap[$name] = $path;
				$name = str_replace('_', '\\', $name); // register again in case it was namespaced
				$this->classMap[$name] = $path;
			}
		}
	}
private function registerDirectory($basePath, $prefix = '') {
		$basePath = str_replace('\\', '/', $basePath);
		$basePath = rtrim($basePath, '/') . '/';
		$prefix = ($prefix ? $prefix . '_' : '' );
		$files = scandir($basePath);
		foreach ($files as $file) {
			if ($file[0] == '.') {
				continue;
			}
			$path = $basePath . $file;
			if (is_dir($path)) {
				$this->registerDirectory($path, $prefix . pathinfo($path, PATHINFO_FILENAME));
			} elseif (strtolower(pathinfo($path, PATHINFO_EXTENSION)) == 'php') {
				$name = $prefix . pathinfo($path, PATHINFO_FILENAME);
				$this->classMap[$name] = $path;
				$name = str_replace('_', '\\', $name); // register again in case it was namespaced
				$this->classMap[$name] = $path;
			}
		}
	}
private function registerDirectory ( $ basePath , $ prefix = '' ) { $ basePath = str_replace ( '\\' , '/' , $ basePath ) ; $ basePath = rtrim ( $ basePath , '/' ) . '/' ; $ prefix = ( $ prefix ? $ prefix . '_' : '' ) ; $ files = scandir ( $ basePath ) ; foreach ( $ files as $ file ) { if ( $ file [ 0 ] == '.' ) { continue ; } $ path = $ basePath . $ file ; if ( is_dir ( $ path ) ) { $ this -> registerDirectory ( $ path , $ prefix . pathinfo ( $ path , PATHINFO_FILENAME ) ) ; } elseif ( strtolower ( pathinfo ( $ path , PATHINFO_EXTENSION ) ) == 'php' ) { $ name = $ prefix . pathinfo ( $ path , PATHINFO_FILENAME ) ; $ this -> classMap [ $ name ] = $ path ; $ name = str_replace ( '_' , '\\' , $ name ) ; // register again in case it was namespaced $ this -> classMap [ $ name ] = $ path ; } } }
Not fully PSR-0 compatible, but good enough for this particular plugin

@param string $basePath
@param string $prefix
Not fully PSR - 0 compatible but good enough for this particular plugin