Organizational Research By

Surprising Reserch Topic

zend 2 run from cli uses http route instead of console route


zend 2 run from cli uses http route instead of console route  using -'php,zend-framework,zend-framework2,console-application'

I am currently working on a zend 2 project and created a console module that i will use with cronjobs. So far i created a standalone project and everything runs fine locally on my working station. Now i uploaded it to my webproject and activated the module. Now i try to run the controller ( route "message" ) but it doesn't use the console route ... it puts out the html that is generated if you call the website with a browser.

    php public/index.php message


Any idea what i am missing ? It works locally in a standalone project but not on the server. Could there be any complications with the other modules on the web project ?

The new module config /module/Console/config/module.config.php:

// This lines opens the configuration for the console routing
'console' => array(
    'router' => array(
        'routes' => array(
            'messagecron' => array(
                'type'    => 'simple',
                'options' => array(
                    'route'    => 'message',
                    'defaults' => array(
                        'controller' => 'Console\Controller\Message',
                        'action'     => 'send'
                    )
                )
            ),

        )
    )
)


It seems that it is using the basic http route from .../module/Application/config/module.config.php

'router' => array(
    'routes' => array(
        'home' => array(
            'type' => 'Zend\Mvc\Router\Http\Literal',
            'options' => array(
                'route' => '/',
                'defaults' => array(
                    'controller' => 'Basic\Controller\Index',
                    'action' => 'index',
                ),
            ),
        ),
    ),
),

    
asked Oct 23, 2015 by rajeshujade
0 votes
0 views



Related Hot Questions



Government Jobs Opening


...