Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Autoloader::register()
  • Hi,

    I would like to create modules as composer packages (actually fuel-module package) and I would like to create bootstrap.php for them.

    I realized that Autoloader::register() is caled after the vendor autoloader (core bootstrap) is called. If I move the autoloader register above that, I can use Autoloader, Config and Event classes in any composer autoloaded FILES (autoloader:file:bootstrap.php).

    My question: can this cause any trouble? :)
  • http://fuelphp.com/blogs/2013/01/fuelphp-and-composer

    This blog entry also says that it should be after Autoloader::register. Why isn't it than? Actually it is a bit uncomfortable for me, that I am using modules, but I have to edit the app bootstrap, to use this functionality.
  • I just realised that Autoloader is accessible from the bootstrap file. Is it a problem to call Autoloader::register() there? So it would be called twice.
  • Composer is only an installer, nothing else. Modules don't have a bootstap, and if it's a package, you just have to add your vendor folder to the package paths, after which you can just load the package like any other.

    You should not have composer do something at load time.

Howdy, Stranger!

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

In this Discussion