Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
\Package::load works fine on local/dev.. production needs \Fuel\Core\Package
  • Hi, like the title says
    Am I missing something? Seems I need to provide a more absolute path or my package won't load dynamically Cheers
  • Local = Windows? Prod = Linux? Perhaps a case issue in either the path or the package name? Or in the files of the packages themselfs.
  • Local = Macbook + MAMP
    Prod = CentOS 5.0 64-bit, Apache, Directadmin This works locally: \Package::
    In production it has to be \Fuel\Core\Package:: I wonder what causes this behaviour, as I use the exact same source on both machines
  • And only for Package? Because the framework access all other core classes from the global namespace as well, so if it's a global fault (for example with the bootstrap), nothing would work. Do you have the exact error message and it's backtrace?
  • Well, turns out I cannot seem to reproduce it, when yesterday I could. I tried both \Package (which failed) en \Fuel\Core\Package quite a few times before I posted this. Obviously it was some kind of resolving issue. I must say I was playing around with hosts files and docroot, but apart from dyn loading this package all of Fuel was fine, just this one package I took out the \Fuel\Core part on production and was expecting the same error, but zippo, stumped Still trying to understand what happened. To be correct; when writing portable code using \Package is the way, right? I don't mind writing longer paths. I don't understand why all of Fuel seemed to be loaded, it gave me a nice Fuelformatted error, but then to fail on not finding \Model_Crud when my package requested it. I debugged all paths in public_html/index.php all where just fine. And preloading the package from config gave me the same result, did find the package, just not Mode_Crud Anyway, thanx for popping in. If I encounter this again I'll post all my info her
  • Correct, all core classes are aliased from the Fuel\Core namespace to the global namespace, to allow you to extend them. You should never (need to) use the Fuel\Core prefix.
  • Turns out I had one packagename hardcoded with a capital, which seems to work fine on my local MAMP install. \Package::load('Getcontent');, works locally, not on server
    \Package::load('getcontent');, works on both Might have missed a convention here, I guess would be lowercase is the prefered choice here?

Howdy, Stranger!

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

In this Discussion