Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Classes subfolder - how to move
  • Hi Guys,

    I'm still in very early investigations of FuelPHP although I think we're going to use it for our software as it does look very good.

    I have found one thing which I feel might want to be a variable in future however and that is having to have controller/models/views in a folder called classes. For some modules which are quite basic there may not be a lot of other subfolders involved.

    Well if you want to move them I have found the 2 locations which (unless I'm wrong) is all you need to change:

    core\classes\autoloader.php - 278
    core\classes\module.php - 96

    I wonder if that could perhaps be a variable/constant in future?

    Thanks though

  • Start by explaining why you have a need to change this? Perhaps there are better ways to solve your problem.

    FuelPHP is already very flexible as to where files are stored (through modules and packages), but in those locations the folder structure is fixed (not only for classes).

    The reason for this is simple, a fixed location limits the number of file lookups, which are a performance it. You don't want the autoloader to have to run a lot of file_exists() checks to be able to load a file...
  • But its 2 extra folders to navigate through and keeps code (in my opinion) in a more centralised fashion. Thats all.
  • Sorry? What folders?

    Again, start by explaining what you want (at the functional level).

    A FuelPHP application that is of reasonable size and is designed in a modular and loosely coupled fashion has dozens of 'classes' folders. We have applications with more than 100...

    Each of these locations have a fixed structure:
    - classes
    - views
    - config
    - vendor
    - lang
    - tests

    This is structured by function, and impossible to merge without creating something very complex, which in turn will make your application difficult to handle, and slow.

Howdy, Stranger!

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

In this Discussion