Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Possible bug - DOCROOT for tasks
  • Just thought I'd report an issue that I ran into that might - or might not - be a bug. I have a file-handling class that has been working fine in unit tests and within Controllers. However, when I wrote a task that used it, it failed to behave as expected.

    After a bit of digging, it turned out to be that the DOCROOT constant is defined differently within tasks. Usually it points to the /public directory, but within a task, it's defined as the project root (ie. one directory above /public). My config files defined a couple of directory locations relative to DOCROOT, so these were no longer being located correctly when accessed from within the task.

    I fixed this by defining them relative to APPPATH instead, which seems to work (perhaps that's what I should have done all along), but thought I'd report this because it was unexpected behaviour and seems like a possible bug.

    (Oh, and for the record, this is with Fuel 1.7.2)
  • This has been discussed for at least 3 years now. ;-)

    Short answer: there is no way the oil frontloader can determine what your definition of DOCROOT is, so it's set to a default value the same way it's done in index.php.

    If you have a need to make it the same, you have to modify it yourself.

Howdy, Stranger!

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

In this Discussion