namespace Fuel\Tasks; class Updates { public function run() { echo "running"; $now = time(); $result = DB::select('*') ->from('users') ->where('time', '<=', $now) ->execute(); } }
Brian Perin wrote on Saturday 26th of November 2011:PHP Fatal error: Class 'Fuel\Tasks\DB' not found in /var/www/project/fuel/app/tasks/updates.php on line 24
Error - Class 'Fuel\Tasks\DB' not found in APPPATH/tasks/updates.php on line 24
\DB::method()
Peter Wiggers wrote on Saturday 26th of November 2011:Brian Perin wrote on Saturday 26th of November 2011:PHP Fatal error: Class 'Fuel\Tasks\DB' not found in /var/www/project/fuel/app/tasks/updates.php on line 24
Error - Class 'Fuel\Tasks\DB' not found in APPPATH/tasks/updates.php on line 24
You're in the Tasks namespace and there is no DB class (that class is in the Core namespace). To load the DB class from the Core namespace, just put a backslash before the class:
\DB::method()
<?php namespace Fuel\Tasks; echo "testing a task"; \DB::select('*') ->from('users') ->execute(); ?>
It looks like you're new here. If you want to get involved, click one of these buttons!