hi, am trying to execute a command with oil script, so when i include or use Fuel::load to load a class , it says class not found, below what am doing :
in the vendor folder i placed a class named eden.php, then i created a task function containing the following code:
public static function foo(){
Fuel::load(APPPATH . 'vendor/eden.php'); $s3 = new Eden_Amazon_S3();
}
when i execute the task in command line i got the error : "PHP Fatal error: Class 'Fuel\Tasks\Eden_Amazon_S3' not found in C:\Server\www\a
brutis\app\tasks\job.php on line 80
Error - Class 'Fuel\Tasks\Eden_Amazon_S3' not found in APPPATH/tasks/job.php
on line 80"
it can't find the class!! the same thing happens when i use include or autoloader!!
You include it in the current scope of the script, with is the Fuel\Tasks namespace, but the file does not contain a namespace, the class is defined in global.
So you need to use
$s3 = new \Eden_Amazon_S3();
to indicate you want to load it from the global namespace.