I have a helper class, which is located in the fuel/app/classes directory.
This helper class is auto loaded by the config.php, so I am able to use it in the entire project, as it contains common methods.
Now I have to create some tasks, and I want to use this helper class.
Because the helper class has no namespace (not needed inside the project), I cannot reach it, and use it.
If I set the namespace Fuel\Tasks in the helper class, in order to be accessible from the tasks area, it cannot be automatically loaded by the config ... i receive this error :
Error - Class Helper defined in your "always_load" config could not be loaded. in COREPATH/classes/fuel.php on line 305
If I comment the class from not beeing anymore auto loaded in config.php, obvious i wont be able to use it in the profject (beeing also namespaced now with Fuel\Tasks)....
So my question is : How can I use the helper class (located in fuel/app/classes) also for my project and also for tasks, keeping in mind that the class should be auto loaded when the fuel starts ?
If the current class is in a namespace, correct. Whenever you want to access a class in another namespace, you have to specify the namespace. Even if that other namespace is "no namespace" (which PHP calls the global namespace).
This is also true for all PHP internal classes, for example \Exception.