huge
huge copied to clipboard
[INFO] Why you should not name your controller "error" (incl. fix) :)
Hello,
It looks like when someone writes something like: http://localhost/huge/error , it's displayed this error :
Fatal error: Cannot redeclare class ErrorController in (path) at line n.
To fix this error, I think it's necessary to remove the lines 51 and 52 at application.php (core folder), because the ErrorController is already declared at line 38.
Regards.
Thanks! But this is tricky, as it will be the same problem with every already used classname, similar things also appear in other older frameworks (unless you use namespaces). As this problem is more an edge case and this project itself is already EOL, I would simply rename the issue and keep it open, so people can find this workaround!
you're right.
Thinking about the title :
Why you should not name your controller "error"
Whatever you want to call the controller for handling errors always you will have this error, at less before we call the error controller, it's checked if it's already declared, something like this.
if(!class_exists('ErrorController')){
require Config::get('PATH_CONTROLLER') . 'ErrorController.php';
$this->controller = new ErrorController;
}
$this->controller->error404();
ups, I closed it.