LoopCommandBundle
Installation and configuration:
Pretty simple with Composer, run:, (*1)
composer require kzdali/loopcommandbundle
Add LoopCommandBundle to your application kernel
// app/AppKernel.php
public function registerBundles()
{
return array(
// ...
new KzDali\LoopCommandBundle\LoopCommandBundle(),
// ...
);
}
Configuration example and Usage
You should configure commands to loop in config.yml, (*2)
loop_commands:
commands: [cache:clear, doctrine:migrations:generate] # comma separated commands
Loop process starts automatically by CheckLoopRunning event listener. When contoller is called, if it implements
LoopCommandInterface loop process starts., (*3)
// src/AppBundle/Controller/SomeConteroller.php
use KzDali\LoopCommandBundle\Controller\LoopCommandInterface;
// ...
class SomeController extends Controller implements LoopCommandInterface
{
// ...
}
To kill loop process, (*4)
php app/console loop_command:kill_process