I'm working on an old site that runs Symfony 1.0
2 weeks ago I wrote a script to import some data from one database to another database. The script worked, and the data was imported. Now I want to run it again, but the script won't work. If I do this:
[pakeException] Task "batch/import_data.php" is not defined.
I also tried this:
But I got the same error.
I ran "symfony cc" and tried again, but I got the same error.
The other programmers who are working on this project have been making a lot of changes to the configuration, so I am thinking possibly they made a change that is causing this to fail? Does anyone have any ideas where I should start to look?
Arturo Linares answers:
If it is a task, it should live in lib/task/YourTask.class.php (for sf1.1 and above) but for 1.0 you can execute it like:
Check your script has the front controller information in the header, something like:
Jakub Zalas answers:
You tried to pass a script path as an argument to symfony command. You should've used name of the task intead. Run 'symfony' in your project directory to list all available tasks.
Also, if you edit your script you'll notice that tasks are really simple functions. Before each one there should be two pake calls: pake_task() and pake_desc(). First defines task name which you can use if you want to run it through symfony.
function run_import_data($task, $args)
You can run it with:
I'm not sure if your scripts are built this way but this is how it was done in symfony 1.0. It looks like you have simple php scripts there which can be run by php command. Tasks need to be put into plugins in symfony 1.0 (i.e. plugins/myTaskPlugin/data/tasks/myPakeMyTask.php). Otherwise symfony won't find them.