Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
"Injecting" Fuel PHP into other applications (as I do with CodeIgniter)
  • So, I'm in kind of a strange development situation where I have several applications that need to play nicely together. Some of those applications are opensource (wordpress and elgg for example) and they sit along side applications that are made from scratch. As an example, I have artist collaboration software written on top of CodeIgniter, a social network by Elgg and a glorified, user-based blog on wordpress. All three of these share a lot of functionality that I've written using codeigniter and "injected" into the others.

    I've done this by bootstrapping a slightly modified Codeigniter index.php file to every page and loading the Super Controller in the output buffer, assigning the SuperObject to a global variable ($CI) and then cleaning the buffer. This allows me to us $CI->load->whatever inside my wordpress plugins or Elgg pages. I've even build a theme system around this.

    I'd love to use FuelPHP for my newest application (love PHP 5.3), but can I do something similar? Am I able to "inject" fuel's libraries, packages or classes into a non-fuel system?

    I grant that there is probably a better way to do what I'm doing. I'm definitely open to suggestions.

    Thanks a lot and thanks for all the work on FuelPHP.

  • Fuel doesn't work from a single object, so I would think it would be a lot more complex. I don't have a ready-made answer for you.

    You'll have to look at the public/index.php. If you set the constants required and loaded the app bootstrap, you should be able to fire a Fuel Request, providing you don't have class name collisions.

Howdy, Stranger!

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

In this Discussion