composer 自动加载
{ "name": "test/demo", "description": "gaoxing test", "type": "project", "license": "1.0", "authors": [ { "name": "John Smith", "email": "john@example.com" } ], "minimum-stability": "dev", "require": { "noahbuscher/macaw": "dev-master", "monolog/monolog": "1.25.2" }, "autoload": {
"classmap": [ "database" ],
"psr-4": { "controllers\\" : "app/controllers/" }, "files": [ "app/helper.php" ] } }
在files中加入的文件可实现单文件自动加载
必须执行composer dump-autoload,自动加载才生效,它会把,这个自动加载写入 自动加载的配置文件中.