Open michsk opened 8 years ago
zend-console
is only required for calling Zend\Console\Console::isConsole()
which does nothing more than PHP_SAPI === 'cli'
.
In my opinion zend-console
should be suggested
dependency only required for using console routes. This means the check if it's a command line environment should be done without zend-console
.
+1
This is definitley a bug!
In my opinion there should be a travis build with --no-dev --o
and one of the following steps:
RequestFactory.php
(e.g. https://github.com/marc-mabe/zf-content-negotiation )Are there any opinions from the maintainers? ping @weierophinney
Best regards alex
+1
The same was the case with me. I agree with the @alexz707.
In my case it occurred while trying to deploying the apigility in heroku. Heroku does not allow deploy in dev mode. But the error occurs in production mode.
From composer.json
:
"suggest": {
"zendframework/zend-console": "^2.3, if you intend to use the RequestFactory"
},
https://github.com/zfcampus/zf-content-negotiation/blob/master/composer.json#L47
And:
$ composer install --no-dev -o
Loading composer repositories with package information
Installing dependencies from lock file
Nothing to install or update
Generating optimized autoload files
All seems to be fine.
If you'd like to use RequestFactory
you must define zend-console
dependency explicitly in your composer.
This repository has been closed and moved to laminas-api-tools/api-tools-content-negotiation; a new issue has been opened at https://github.com/laminas-api-tools/api-tools-content-negotiation/issues/6.
In
ZF\ContentNegotiation\Factory\RequestFactory
we have a dependency onZend\Console\Console
andZend\Console\Request
but those are not defined in the composer.json. Now when i callcomposer install --no-dev --o
i get the error( ! ) Fatal error: Uncaught Error: Class 'Zend\Console\Console' not found in /srv/www/kp-webservice/vendor/zfcampus/zf-content-negotiation/src/Factory/RequestFactory.php on line 22