public function registerAutoloader($baseDir, $baseNs)
    {
        $baseNs = $baseNs[strlen($baseNs) - 1] == '\\' ? $baseNs : "{$baseNs}\\";
        $baseDir = rtrim($baseDir, '/');

        spl_autoload_register(
            function ($class) use ($baseDir, $baseNs) {
                if (strncmp($baseNs, $class, strlen($baseNs)) == 0) {
                    $filename = str_replace(
                        '\\',
                        '/',
                        $baseDir.'/'.substr($class, strlen($baseNs)).'.php'
                    );
                    if (file_exists($filename)) {
                        if (defined('FOCUS_DEBUG') && FOCUS_DEBUG) {
                            $this->getLogger()->debug('automatic load file '.$filename);
                        }

                        include $filename;

                        if (defined('FOCUS_DEBUG') && FOCUS_DEBUG) {
                            $this->getLogger()->debug("file {$filename} loaded");
                        }
                    }
                }
            },
            true,
            false
        );
    }
public function registerAutoloader($baseDir, $baseNs)
    {
        $baseNs = $baseNs[strlen($baseNs) - 1] == '\\' ? $baseNs : "{$baseNs}\\";
        $baseDir = rtrim($baseDir, '/');

        spl_autoload_register(
            function ($class) use ($baseDir, $baseNs) {
                if (strncmp($baseNs, $class, strlen($baseNs)) == 0) {
                    $filename = str_replace(
                        '\\',
                        '/',
                        $baseDir.'/'.substr($class, strlen($baseNs)).'.php'
                    );
                    if (file_exists($filename)) {
                        if (defined('FOCUS_DEBUG') && FOCUS_DEBUG) {
                            $this->getLogger()->debug('automatic load file '.$filename);
                        }

                        include $filename;

                        if (defined('FOCUS_DEBUG') && FOCUS_DEBUG) {
                            $this->getLogger()->debug("file {$filename} loaded");
                        }
                    }
                }
            },
            true,
            false
        );
    }
public function registerAutoloader ( $ baseDir , $ baseNs ) { $ baseNs = $ baseNs [ strlen ( $ baseNs ) - 1 ] == '\\' ? $ baseNs : "{$baseNs}\\" ; $ baseDir = rtrim ( $ baseDir , '/' ) ; spl_autoload_register ( function ( $ class ) use ( $ baseDir , $ baseNs ) { if ( strncmp ( $ baseNs , $ class , strlen ( $ baseNs ) ) == 0 ) { $ filename = str_replace ( '\\' , '/' , $ baseDir . '/' . substr ( $ class , strlen ( $ baseNs ) ) . '.php' ) ; if ( file_exists ( $ filename ) ) { if ( defined ( 'FOCUS_DEBUG' ) && FOCUS_DEBUG ) { $ this -> getLogger ( ) -> debug ( 'automatic load file ' . $ filename ) ; } include $ filename ; if ( defined ( 'FOCUS_DEBUG' ) && FOCUS_DEBUG ) { $ this -> getLogger ( ) -> debug ( "file {$filename} loaded" ) ; } } } } , true , false ) ; }
register class autoloader.

@param string $baseDir Root directory of the project
@param string $baseNs  Basic namespace
register class autoloader .