Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Strange Errors
  • Hello,

    im having strange errors. In PHP Version 5.3.1 (Locally) they dont appear but in 5.3.2 ( Online ) they do.

    Fatal error: Class 'ComponentController' not found in...

    This file is used by components in "root/components" inside the controllers. It looks like it doenst get autoloaded but i dont know why not.

    The second error i getting is:
    Fatal error: Constructor CoffeeScript\Init::init() cannot be static in fuel/packages/coffeescript/classes/Init.php on line 76 Fatal error: Class declarations may not be nested in fuel/core/classes/error.php on line 19


    If i commenting all, this error disappears and the above one pops up.

    Honestly i dont know how i can solve these problems, thats why my Question is, if someone have an idea to solve this?

    Thanks in advance
  • The Fuel autoloader requires all filenames to be lowercase.

    You don't mention the OS you're using, but on Windows (and some Mac-OS versions) you can get away with mixed-case filenames, on other platforms you don't.

    So fuel/app/classes/componentController.php is not a valid name. Note that this will change in the near future when we move to PSR-1 and the composer autoloader.

    Second problem you have it that the Init class has a static method called 'init'. In PHP, for PHP4 compatibility reasons, if a class doesn't have a constructor defined, PHP will look for a method with the same name as the class. As constructors are used in object instantiation, they can not be static.
  • Thank you for the fast reply!

    I got both problem solved.

Howdy, Stranger!

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

In this Discussion