php - Composer doesnt update autoload namespace -
composer not updating autoload_namespaces.php file, despite downloading bundle normaly. can't understand did mistake. if load packagist, namespaces file updating successfully.
project structure
main composer.json
{ "repositories":[ { "type": "package", "package": { "name": "test/framework", "version": "1.0.0.1", "dist": { "url": "http://localhost/repo/1.zip", "type": "zip" } } } ], "require": { "test/framework": "*" } } package composer.json
{ "name": "test/framework", "type": "library", "require": { "php": ">=5.2.4" }, "autoload": { "psr-0" : { "test" : "lib/" } } } autoload_namespaces.php
<?php // autoload_namespaces.php @generated composer $vendordir = dirname(dirname(__file__)); $basedir = dirname($vendordir); homecoming array( );
you downloading bundle defined in repositories via zip.
https://getcomposer.org/doc/05-repositories.md#package-2
in case sense should define bundle definition @ same place. see above link illustration contains autoload definition defined.
{ "repositories":[ { "type": "package", "package": { "name": "test/framework", "version": "1.0.0.1", "dist": { "url": "http://localhost/repo/1.zip", "type": "zip" }, "autoload": { "psr-4" : { "test\\": "lib" } } } } ], "require": { "test/framework": "*" } } you can seek variation see post on http://harikt.com/blog/2014/05/29/hidden-gems-of-composer/
ps : psr-4 recommended way can autoload psr-0 structured classes. see https://getcomposer.org/doc/04-schema.md#autoload
php namespaces composer-php
No comments:
Post a Comment