php - Predis Autoloader doesn't load -
i use composer add external libraries project - including predis.
for reason predis not being generated , receive:
class 'predis\autoloader' not found
so dived composer loading files , find weird things follow:
this composer.json:
{ "require": { "facebook/php-sdk": "@stable", "everyman/neo4jphp": "dev-master", "predis/predis": "1.1.*@dev", "aws/aws-sdk-php": "2.*" }, "autoload": { "psr-0": { "picocore\\": "", "picocore\\authentication\\" : "picocore/authentication", "picocore\\aws\\" : "picocore/aws", "picocore\\cache\\" : "picocore/cache", "picocore\\database\\" : "picocore/database", "picocore\\facebook\\" : "picocore/facebook", "picocore\\objects\\" : "picocore/objects", "picocore\\rest\\" : "picocore/rest", "picocore\\configuration\\" : "picocore/configuration", "picocore\\configuration\\api\\" : "picocore/configuration/api", "picocore\\scripts\\" : "picocore/scripts", "picocore\\times" : "picocore/times" } } }
now, wanted see how generated namespace predis looks checked autoload_par4.php inside composer folder , how looks:
<?php // autoload_psr4.php @generated composer $vendordir = dirname(dirname(__file__)); $basedir = dirname($vendordir); return array( 'symfony\\component\\eventdispatcher\\' => array($vendordir . '/symfony/event-dispatcher'), 'predis\\' => array($vendordir . '/predis/predis/picocore'), );
now, if you'll notice see predis namespace path /predis/predis/picocore
(picocore application namespace) when supposed
/predis/predis/src
when manunally change - works fine, problem whenever update composer, again..
any ideas why or take path , why add project name?
by way, looked @ composer.json of predis , change , looks followed:
{ "name": "predis/predis", "type": "library", "description": "flexible , feature-complete php client library redis", "keywords": ["nosql", "redis", "predis"], "homepage": "http://github.com/nrk/predis", "license": "mit", "support": { "issues": "https://github.com/nrk/predis/issues" }, "authors": [ { "name": "daniele alessandri", "email": "suppakilla@gmail.com", "homepage": "http://clorophilla.net" } ], "require": { "php": ">=5.3.9" }, "require-dev": { "phpunit/phpunit": "~4.0" }, "suggest": { "ext-phpiredis": "allows faster serialization , deserialization of redis protocol", "ext-curl": "allows access webdis when paired phpiredis" }, "autoload": { "psr-4": {"predis\\": "src/"} }, "extra": { "branch-alias": { "dev-master": "1.1-dev" } } }
the problem added dependency of:
"predis/predis": "1.1.*@dev"
while needed:
"predis/predis": "1.0.1"
Comments
Post a Comment