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?
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?
I use mamp php 7.1.1 https://www.mamp.info/en/downloads/
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.
Most helpful comment
oh, the problem was that now we need
public function beforeExecuteRoute($dispatcher) {not
protected function beforeExecuteRoute($dispatcher) {thanks