Exception raised when AbstractActionController::notFoundAction is invoked in console environment #2625

Closed
adamlundrigan opened this Issue Sep 30, 2012 · 2 comments

Projects

None yet

4 participants

@adamlundrigan
Member

When a properly-configured console route routes to a controller which exists but the requested action does not, an exception is raised due to Zend\Console\Response not having a setStatusCode method:

PHP Fatal error:  Call to undefined method Zend\Console\Response::setStatusCode() in <dir>/library/Zend/Mvc/Controller/AbstractActionController.php on line 54

Routing Configuration:

    'console' => array(
        'router' => array(
            'routes' => array(
                'ldcdemo-start-game' => array(
                    'options' => array(
                        'route' => 'demo game start <gameId>',
                        'defaults' => array(
                            'controller' => 'LdcDemo\Controller\Game',
                            'action'     => 'start',
                        ),
                    ),
                ),
            ),
        ),
    ),
    'controllers' => array(
        'invokables' => array(
            'LdcDemo\Controller\Game' => 'LdcDemo\Controller\GameController',
        ),
    ),

Controller Class:

<?php
namespace LdcDemo\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;

class GameController extends AbstractActionController
{
}

Same result against 2.0.2 and dev-master

@imel96
Contributor
imel96 commented Nov 26, 2013

I think this issue can be closed, I can't reproduce it with 2.2.5. I get "Page not found".

@samsonasik
Contributor

ping @adamlundrigan I think it can be closed now ;)

@Ocramius Ocramius self-assigned this Jun 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment