php - How to create ZF3 console application -


in zend framework 2 it's simple add initial module banner console applications.

all need implement getconsolebanner , getconsoleusage methods , implement zend\modulemanager\feature\consoleusageproviderinterface or consolebannerproviderinterface interfaces.

this enough dump messages in console when public/index.php started via cli.

in zend framework 3 it's not same.

doing same setup not provide same result. in console see default html page skeleton app same way visit via browser.

that page being seen before install custom module: here docs zend-mvc-console module https://zendframework.github.io/zend-mvc-console/intro/

even after module installed suggested ('zend\mvc\console' added in module definitions) console banners not shown. i've tested var dumping inside methods , i'm able view data, framework executes methods shows no result in console.

i've tested console routes , controllers. route found, controller action executed nothing shown in cli again.

i've digged in code of framework , seems zend\mvc\console\responsesender\consoleresponsesender class never executed.

do have register view_manager strategies in order displayed in cli?

here sources on top of zf3 skeleton application: https://gist.github.com/kachar/06f0c9096bcc1cc0b00f4612aed1b68b

running app:

$ php -v php 7.0.6 (cli) (built: apr 27 2016 14:00:40) ( zts ) copyright (c) 1997-2016 php group zend engine v3.0.0, copyright (c) 1998-2016 zend technologies  $ php public/index.php application\module::getconsolebanner application\module::getconsoleusage  $ php public/index.php user application\controller\indexcontroller::indexaction 

per our own documentation, mvc <-> console integration deprecated. recommend using zf-console or symfony console building console functionality application.

we are aware of issues zend-mvc-console, , we'll issuing patch release address them, fix short-term problems. however, recommend migrating solution in long-term.


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -