我正在创建类型为library
的composer包。并试图将它要求到Symfony2项目。
该软件包具有以下composer.json
{
"name": "vendor/package-sdk",
"description": "My private package",
"type": "library",
"license": "MIT",
"autoload": {
"psr-4": {"Vendor\\PackageSDK\\": "src/"}
},
"require": {
"php": ">=5.3.3"
}
}
然后我需要它到我的SF2项目。
"repositories": [
{
"type": "git",
"url": "git@github.com:me/vendor-package-sdk.git"
},
],
"require": {
...
"vendor/package-sdk": "~0.0.1-alpha1"
...
}
当我打电话时
use Vendor\PackageSDK\Client;
...
$client = new Client();
```
我得到了致命的错误:
PHP Fatal error: Class 'Vendor\PackageSDK\Client' not found in /path
如果我这样做
composer dump-autoload -o
它有效,但
composer dump-autoload
不
vendor / composer / autoload_psr4.php 文件包含:
'Vendor\\PackageSDK\\' => array($vendorDir . '/vendor/package-sdk/src'),
有人能告诉我我做错了什么吗?
答案 0 :(得分:-1)
在composer autoload_classmap.php 文件中,我看到以下行
'Vendor \ PackageSDK \ Client'=> $ vendorDir。 '/vendor/package-sdk/src/Cilent.php',
所以这只是包
文件名中的拼写错误Cilent .php应为客户端 .php