我正在使用laravel4,这是我的composer.json文件...
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"laravel/framework": "4.1.*",
"iron-io/iron_mq": "1.5.1"
},
"autoload": {
"classmap": [
"app/commands",
"app/controllers",
"app/models",
"app/database/migrations",
"app/database/seeds",
"app/tests/TestCase.php"
]
},
"psr-4": {
"iw\" : "app/iw"
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
},
"minimum-stability": "stable"
}
但它没有将 iw//添加到供应商/autoload_ps4.php,它显示以下内容....
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'Monolog\' => array($vendorDir . '/monolog/monolog/src/Monolog'),
);
现在它如何在不引用 composer.json 的情况下显示 Monolog......
我尝试运行命令composer update
和composer dump
。 真的需要你的帮助来解决这个问题。谢谢
PSR-4 需要在自动加载范围内。
"autoload": {
"classmap": [
"app/commands",
"app/controllers",
"app/models",
"app/database/migrations",
"app/database/seeds",
"app/tests/TestCase.php"
],
"psr-4": {
"iw\" : "app/iw"
},
},
Laravel需要Monolog,所以它被包含在你的项目中。
项目所依赖的以及通过composer.json
文件包含的每个包可能具有它们所依赖的其他包。这些也将下载到您的vendors
文件夹中,并包含在您的自动加载文件中。