Open curtiskelsey opened 6 years ago
We have deprecated usage of console tooling with zend-mvc.
The recommendation is to instead use something like zf-console or symfony/console for developing console applications.
In terms of getting service definitions to those console applications, you may still end up with similar issues. The best way to combat them: when building your PHAR file, compile the configuration. Once compiled, have the phar use the compiled configuration; this is already built-in in the ConfigListener
anyways, and will prevent the need for globbing.
That is the exact wisdom I needed. Thanks! I will compile the config.
This repository has been closed and moved to laminas/laminas-modulemanager; a new issue has been opened at https://github.com/laminas/laminas-modulemanager/issues/1.
After developing a Zend MVC application with console components, it is desired to package the console components and all services into a phar. After packaging the application into a phar the application ceases to run due to configuration issues. The issues stem from the ModuleManager's use of glob to autoload config files. The glob command does not support stream wrappers. Would it make sense to eliminate the need for glob within the package?
Code to reproduce the issue
The implementation is https://github.com/zfcampus/zf-console on a standard Zend MVC application. To recreate the issue you must have a module that depends on configuration that is only included in the autoloaded config files to execute, such as a custom usage of the Doctrine Migrations package then package the application as a phar. The problem stems from the
ConfigListener::addConfigByPath($path, $type)
method or, to continue tracing it, TheGlob::glob()
method in the Zend standard library:Expected results
Actual results