Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Autoloading capitilised classes
  • Fuel's coding standards mean that the autoloader looks for capitilised class and namespaces in lowercase files and directories. Which makes sense, I understand why you have decided to go with the "all lower case file structure" convention. However it means that the autoloader can't be used to load 3rd party libraries that follow the convention of having capitilised directories and files. Not on a case sensitive file system anyway. Is there are way around this that I have missed?
    Do I need to extend and replace the core autoloader to do this?
  • You can use the add_classes() section of your app bootstrap.php to define custom class -> file mappings.
  • Also you can make packages use PSR-0 style loading by setting it in the package's bootstrap. Check out the Autoloader::add_namespace() method's 3rd param.
  • Thanks Jelmer, thats exactly what I was looking for,
    its missing from the docs, will check source next time
  • added the missing info to the docs.

Howdy, Stranger!

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

In this Discussion