Cphalcon: Call to undefined method ::beforeexecuteroute() Phalcon 3.2.0

Created on 23 Jun 2017  路  14Comments  路  Source: phalcon/cphalcon

I updated Phalcon from 3.1.2 to 3.2.0 version and now have exception: Exception: Call to undefined method ::beforeexecuteroute()

class AuthController extends Controller {
  public function beforeExecuteRoute($dispatcher) {
     ... 
  }
  ...
}

This function exists in the 3.2.0 version: https://docs.phalconphp.com/en/3.2/controllers Can you help me?

Details

  • Phalcon version: 3.2.0
  • PHP Version:PHP 7.1.1
  • Operating System: macOS Sierra
  • Installation type: Compiling from source
  • Powered by Zephir Version 0.9.9-868cb1f92b

Most helpful comment

oh, the problem was that now we need
public function beforeExecuteRoute($dispatcher) {
not
protected function beforeExecuteRoute($dispatcher) {

thanks

All 14 comments

I think this is somehow zephir issue @sjinks

Returned 3.1.2 version but the error still remains,
Installation type: brew install php71-phalcon
Phalcon version: 3.1.2
PHP Version: PHP 7.1.1
Zephir: Version 0.9.7-1fae5e50ac

Did you restarted web server after you re-installed 3.1.2?

Yes, of course

Can't reproduce.

$di = new FactoryDefault();
$di->set('view', new \Phalcon\Mvc\View());

class IndexController extends \Phalcon\Mvc\Controller
{
    public function beforeExecuteRoute($dispatcher)
    {
        var_dump("test");
    }

    public function indexAction()
    {
        return "test";
    }
}

$application = new \Phalcon\Mvc\Application($di);
echo $application->handle()->getContent();
var_dump(phpinfo());

Works for me on php 7.1.0 and phalcon 3.2.0 compiled using zephir Version 0.9.8-63a35e13c5.

Though i saw somewhere else similar problem.

I think the problem with PHP 7.1.1 (+phalcon),
Yesterday I used Phalcon 3.1.2 with php5.6.29 without any problems

But i use php 7.1.0, do you use TS or NTS? This code above breaks for you too?

Just check in phpinfo() is this TS or NTS?

Though im guessing it's NTS, still, can't reproduce.

Maybe there are some more steps? Post full code to reproduce.

PHP Extension Build API20160303,NTS
Thread Safety disabled
this?

Yea, then idk, need full code to reproduce issue.

oh, the problem was that now we need
public function beforeExecuteRoute($dispatcher) {
not
protected function beforeExecuteRoute($dispatcher) {

thanks

Haha, good to know.

Well we need to update it to is_callable and hopefully it will be fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EquaI1ty picture EquaI1ty  路  3Comments

fonqing picture fonqing  路  3Comments

dimak08 picture dimak08  路  3Comments

bestirani2 picture bestirani2  路  3Comments

kkstun picture kkstun  路  3Comments