Hi there, I'm still trying to implement some third party toolkits into Fuel but I have question.
I have some files named like that: PREFIX_NameSomething.php with class inside it named PREFIX_NameSomething
And I'm getting several errors depends on what method of including that class it use.
Autoload: Fuel\Core\Fuel_Exception [ Error ]: Always load class does not exist.
require_once(): ErrorException [ Error ]: Class 'PREFIX_NameSomething' not found
Might it be caused by wrong naming?
I loaded several classes but that particulal class is abstract - some problems with abstract classes?
Place where second error appers looks that:
class PREFIX_Name extends PREFIX_NameSomething
{
...
The error is caused when the autoloader can't find the class, will have nothing to do with it being abstract as the process doesn't care about instanciating it.
Filepaths in fuel are fully lowercased and each underscore is translated into a directory separator. Thus this: PREFIX_NameSomething
is expected at: app/classes/prefix/namesomething.php
Multi-file third party libs often come with their own autoloader or are best included using include/require. We put those into a "vendor" dir when we do this ourselves (check out core/vendor for example). Those are libs that are outside the normal autoloading and made by a third party.
Thanks, that really helped me.
Only error that I occasionally get is: Warning: require(/opt/lampp/fuel/core/classes/Fuel\Core\Fuel) [function.require]: failed to open stream: No such file or directory in /opt/lampp/fuel/core/bootstrap.php on line 41
Fatal error: require() [function.require]: Failed opening required '/opt/lampp/fuel/core/classes/Fuel\Core\Fuel' (include_path='.:/opt/lampp/lib/php') in /opt/lampp/fuel/core/bootstrap.php on line 41
This error seams to appear when I try to echo some values (just for testing). Strange thing is when I remove code including echo something; I still need to refresh page around 10 times to get it work (cache of something?).
However, I successfully included third party library and it seems to work