ybRunTaskPlugin - 0.1.2

Run a task wihtin an action

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to the Plugins Home

Signin


Forgot your password?
Create an account

Tools

Stats

advanced search
Information Readme Releases Changelog Contribute
ybRunTaskPlugin 0.1.2beta for sf 1.4sf 1.3 MIT
Plugin image
4
users
Sign-in
to change
your status

Run a task wihtin an action

ybRunTaskPlugin

The ybRunTaskPlugin allow you to run a task within an action, just like you'd be doing in a task

Installation

  • Install the plugin

    $ symfony plugin:install ybRunTaskPlugin
    
  • Add the plugin to the loaded plugin in your config/ProjectConfiguration.class.php $this->enablePlugins('ybRunTaskPlugin');

  • Clear your cache

    $ symfony cc
    

Usage

You can now run a task from an action

    class homeActions extends sfActions
    {
        public function executeRuntask(sfWebRequest $request) {
            $ret = $this->runTask('generate:task', 'hello');
            if(null != $ret) {
                $this->msg = $ret->getMessage();
            } else {
                $this->msg = 'doing fine ?';
            }
        }
    }

Explanation

For now, the method returns nothing if the task ran fine. Otherwise it returns an exception.

TODO

Maybe catch the logSection events, store them and return them to the action.

Thanks

Thanks to Garfield-Fr on #symfony-fr@freenode and Nicolas loeuillet for small pieces of code.

Developers

Name Status Email
gravatar Yoda-BZH lead moc.liamg <<ta>> hzbadoy

License

Show source
MIT license