基于psr的规范,使用命名空间和spl_autoload_register()来实现自动加载 文件结构: |–Api |–Account.php |–User.php |–Service |–Login.php |–User.php |–Application.php Application.php <?php use Api\User; use Service\User as User2; class Application{ public static function main(){ self::registe(); new User();