Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
V1.3 event problem
  • I'm trying to upgrade from v1.2.1 to 1.3 and immediately running into a problem. When I try to load a page, I get a debugger message that "File 'event' does not exist." From tracing through the code, it appears that the /core/classes/config/file.php function find_file() which ultimately calls /core/classes/finder.php function locate() is looking for a file config/development/event.php, but there is no such file. Anyone have any idea what's going on or what I should try next? All of this occurs after /core/classes/event.php function _init() calls \Config::load('event', true);
  • That is odd. Where exactly do you get this message? And what message? A PHP error? An exception thrown? Where exactly in the code? Because config files don't need to exist (a lot of them don't by default), that should not generate a message. I've just checked the app I'm currently working on, and that doesn't have an event config file either.
  • Just checked the code. The Config file loader does throw a ConfigException when the file is not found. But this is caught by Config::load:
       try
       {
        $config = $file->load($overwrite);
       }
       catch (\ConfigException $e)
       {
        $config = array();
       }
    
    which sets the config array to empty. You should not see this exception anywhere. How are you exactly debugging? If you're using an external debugger like dbg, off course it will pick up this exception. But the Core uses Exceptions everywhere, it's the main signalling mechanism, that's what Execeptions are for.
  • The actual message is an exception from core/classes/config/file.php function find_file, line 127:
    throw new \ConfigException(sprintf('File "%s" does not exist.', $this->file));
    
    I am debugging using the debugger with PhpED, so it does pick up the exception. You are correct that it's caught by Config::load() and sets the config array to empty. I've been using Fuel and PhpED for quite a while now, and this is the first time I've seen an Exception flagged that wasn't an actual problem, so I guess I was surprised to see this with every page load. I have the option of setting the debugger to ignore this exception, however that means it will also ignore any cases where there really is a missing file.

Howdy, Stranger!

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

In this Discussion