<?php

spl_autoload_register(function($className) {
	echo $className."\n";exit;
    $className = ltrim($className, '\\');
    $fileName  = '';
    $namespace = '';
    if ($lastNsPos = strrpos($className, '\\')) {
        $namespace = substr($className, 0, $lastNsPos);
        $className = substr($className, $lastNsPos + 1);
        $fileName  = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
    }
    $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
	
	$fileName = DOL_DOCUMENT_ROOT . DIRECTORY_SEPARATOR.'custom' . DIRECTORY_SEPARATOR . 'nav' . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . $fileName;
	
	if (file_exists($fileName)) {
        require($fileName);
    }
});