Tag Archive for 'tasks'

17
Feb

Pake Task Locations and File Naming Conventions

I was writing a custom Pake task for a project and was completely stumped as to why the task wouldn’t show up from the command line. Since I only usually write pake tasks for plugins, I was completely confused as to why a file named tasks.php in myproject/data/tasks wouldn’t register its tasks. It turns out that symfony has very specific file naming conventions for Pake tasks depending on where you’re writing them.

Symfony tasks located in:

sf_symfony_data_dir/tasks (the symfony library’s tasks) must have an sfPake*.php naming scheme

sf_data_dir/tasks (your project’s tasks) must have a myPake*.php naming scheme

… and of course plugin tasks located in sf_root_dir/plugins/*/data/tasks can use *.php (which is probably why I’ve never run into this little conundrum before.

You can check which tasks are registered in your project by running:

symfony -T

… at the command line.