composer php - autoload psr-4 gets lost during install -
this composer.json of bundle (shortened)
{ "name": "acme/my-bundle", "type": "library", "version": "0.5.0", "autoload": { "psr-4": { "acme\\mybundle\\": "" } } }
and in project:
"require": { "acme/my-bundle": "dev-master" },
then run composer install
resulting in installed.json like
[ { "name": "acme/my-bundle", "version": "dev-master", "version_normalized": "9999999-dev", "type": "library", "installation-source": "source" // // here must this: // "autoload": { // "psr-4": { // "acme\\mybundle\\": "" // } // }, // these lines missing! // } ]
and autoload-psr4.php:
<?php // autoload_psr4.php @generated composer $vendordir = dirname(dirname(__file__)); $basedir = dirname($vendordir); return array( /* here must this: * 'acme\\mybundle\\' => array($vendordir . '/acme/my-bundle'), * line missing! */ );
the autoload gone, , other keys require
what missing?
i tried psr-0, no success. autoload_namespaces.php empty array.
i did not mention, wanted fetch package private repo! make difference!
so had re-specify autoload
"require": { "acme/my-bundle": "dev-master" }, "repositories": [ { "type": "package", "package": { "version": "dev-master", "name": "acme/my-bundle", "source": { "url": "ssh://git@example.com/acme/my-bundle", "type": "git", "reference": "test" }, // | // additional v "autoload": { "psr-4": { "acme\\mybundle\\": "" } } } } ]
see https://stackoverflow.com/a/24193122/816362 @zacharydanger
Comments
Post a Comment