Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Using an App version rather than Core
  • I'd like to change something in the Core file - so I'm not really extending it, just replacing it. How can I use a copy of that file in my app, rather than using the core?
  • I think that this should be in the Docs because it's not easy to figure out how to do it otherwise. I appreciate your argument that you shouldn't have to do it, but I did - and I might not be in a position to wait for the next stable release. I'll add this to the Docs and do a pull request, see what feedback is?
  • Extending and replacing works exactly the same way. Create the class file in app/classes, and add it to the app bootstrap. It extends when you use 'extends', it replaces when you don't.
  • Dammit, I got the first bit but not the second bit. Is this instruction in the Docs anywhere, I'll add it if not?
  • It's not in the docs because we don't consider it best practice. Either it's a core class that needs tinkering, in which case you extend and replace our augment only what's needed. This way you make it absolutely clear it's about core functionality. Or it's an application class (which in this case has the same function as a core class), which has a name that doesn't collide with a core class. The danger of replaceing a core class is that one day you're going to upgrade the core, and wonder why your app doesn't work anymore.
  • In that case see my core/docs pull request for my tinkering!
  • Bit odd... 'Upload' => APPPATH.'classes/upload.php', Added to bootstrap but I get this error ErrorException [ Error ]: Class 'Upload' not found When attempting to use Upload::process($config)
  • Did you remove the \Fuel\Core namespace from your copied version? The class in app/classes should not have a namespace defined.
  • Ah no, thanks!

Howdy, Stranger!

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

In this Discussion