Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
General
Task and oil
Gonab
November 2012
I have a method that update my database from .txt files. This works fine from the browser when I go to :
http://localhost/intranet/public/admin/stockvn/integration
I'd like to use windows task scheduler to launch a command line with oil, so i create a Task inside fuel/app :
class Import
{
public static function run()
{
Admin_Stockvn::action_integration();
}
but when i do : php oil refine import ... I have this error :
PHP Fatal error: Class 'Fuel\Tasks\Admin_Stockvn' not found in C:\wamp\www\intranet\fuel\app\tasks\import.php on line 20
PHP Stack trace:
PHP 1. {main}() C:\wamp\www\intranet\oil:0
PHP 2. Oil\Command::init() C:\wamp\www\intranet\oil:46
PHP 3. call_user_func() C:\wamp\www\intranet\fuel\packages\oil\classes\command.php:120
PHP 4. Oil\Refine::run() C:\wamp\www\intranet\fuel\packages\oil\classes\command.php:120
PHP 5. call_user_func_array() C:\wamp\www\intranet\fuel\packages\oil\classes\refine.php:99
PHP 6. Fuel\Tasks\Import->run() C:\wamp\www\intranet\fuel\packages\oil\classes\refine.php:99
Error - Class 'Fuel\Tasks\Admin_Stockvn' not found in APPPATH/tasks/import.php on line 20
I know that my method is not supposed to be called on command line.
Sorry if it's a dumb question, but I'm totally confuse with this section. Need help.
Thx in advance.
Harro
November 2012
Accepted Answer
Tasks (and Migrations) don't follow the cascading filesystem principe, and aren't autoloadable.
So a class called "
Admin_Stockvn" will be loaded from "
a
dmin_stockvn.php" in the tasks folder, no subdirectories are supported.
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,088
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
260
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Harro
November 2012