Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Controller Router problems with log package
  • Hi

    I'm trying to run an old project of mine that used Fuel 1.2/1.3 and I had a router method in my base controller that would check if the method existed in any controller, if not, it would then look to see if a page existed, if not, it would catch the error.

    However right now the error it gives is:
    Fatal error: Call to a member function log() on a non-object on line 91
    The router code is:
    public function router($method, $params) {
    $action = "action_$method";
    // if method exists call it
    if(method_exists($this, $action)) {
    $this->{$action}($params);
    }
    else {
    // Try and load the view
    try {
    $this->display("page/$method");
    } catch(Fuel_Exception $e) {
    Request::show_404();
    }
    }
    }

    Even if I get rid of the code inside the function, the response just always give that error about the log. I understand the log has moved to it's own package recently however cannot understand what is causing this error.
  • HarroHarro
    Accepted Answer
    For 1.5 and 1.5.1, the Log package needs to be installed AND loaded.

    If you migrate from a previous version, you have to add the Log package to your always_load manually, as the core needs the Log class to work.

    We've in the meantime have a better solution, which will be part of v1.6.
  • HarroHarro
    Accepted Answer
    p.s. you can also get this message if there is no write access to the log files, but as this is a migration from a previous version, that is unlikely.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion