Introduction
I am getting strange error in zf2. I don't know why, but I am getting some routing error. I don't get any messages, but needed controller is not loaded, but another one do. All looking fine, so it is not good idea to ask here to help me to solve this problem, so I am trying to debug this by myself.
What I have tried?
I tried debug_backtrace()
function in /public/index.php
file like this:
// Setup autoloading
require 'init_autoloader.php';
// Run the application!
Zend\Mvc\Application::init(require 'config/application.config.php')->run();
var_dump(debug_backtrace());
It shows nothing.
Just to check if function is working I tried:
function bob() {
var_dump(debug_backtrace());
}
bob();
And this showed me what params were passed, what functions called etc. This showed me, that function is executed correctly, but this function is not used in my case.
Question
Is there any ways to get what functions was executed in app?
I think you slightly misunderstand what
debug_backtrace()
does. It lists the function calls that led to the place in code where the backtrace is. So in yourbob()
example, it will show that function (asbob()
was called). But if you just calldebug_backtrace()
inpublic/index.php
, that's not executed within any functions, which is why you don't get any output.