spl_autoload_register
<?php use \jsmcm\Logger\Log; use \manfred\Reader\Read; spl_autoload_register(function($class){ $baseDirectory = __DIR__.’/src/’; $classPath = str_replace("\\", "/", $class).".php"; if (file_exists($baseDirectory.$classPath)) { require $baseDirectory.$classPath; } }); $oLog = new Log(); $oRead = new Read();