symfony API

sfTask Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.1 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.1 version. Switch to:
This version of symfony is not maintained anymore.
If some of your projects still use this version, consider upgrading as soon as possible.

Abstract class for all tasks.

Inheritence

sfCommandApplicationTask  <  sfTask

Method Summary

  • addArgument()
    Add an argument.
  • addArguments($arguments)
    Adds an array of argument objects.
  • addOption()
    Add an option.
  • addOptions($options)
    Adds an array of option objects.
  • configure()
    Configures the current task.
  • doRun()
  • integer execute($arguments, $options)
    Executes the current task.
  • array getAliases()
    Returns the aliases for the task.
  • sfCommandArgument getArguments()
    Returns the argument objects.
  • string getBriefDescription()
    Returns the brief description for the task.
  • string getDetailedDescription()
    Returns the detailed description for the task.
  • string getFullName()
    Returns the fully qualified task name.
  • string getName()
    Returns the task name
  • getNamespace()
    Returns the task namespace.
  • sfCommandOption getOptions()
    Returns the options objects.
  • getSynopsis()
    Returns the synopsis for the task.
  • initialize($dispatcher, $formatter)
    Initializes the sfTask instance.
  • log($messages)
    Logs a message.
  • logSection($section, $message, $size, $style)
    Logs a message in a section.
  • process()
  • integer run($arguments, $options)
    Runs the task.
  • integer runFromCLI($commandManager, $options)
    Runs the task from the CLI.
  • __construct($dispatcher, $formatter)
    Constructor.

Method Details

  • addArgument () Browse code

    Add an argument.


    This method always use the sfCommandArgument class to create an option.

  • addArguments ($arguments) Browse code

    $arguments An array of arguments

    Adds an array of argument objects.

  • addOption () Browse code

    Add an option.


    This method always use the sfCommandOption class to create an option.

  • addOptions ($options) Browse code

    $options An array of options

    Adds an array of option objects.

  • configure () Browse code

    Configures the current task.

  • doRun () Browse code

  • (integer) execute ($arguments, $options) Browse code

    $arguments An array of arguments
    $options An array of options

    Executes the current task.

    returns 0 if everything went fine, or an error code

  • (array) getAliases () Browse code

    Returns the aliases for the task.

    returns An array of aliases for the task

  • (sfCommandArgument) getArguments () Browse code

    Returns the argument objects.

    returns An array of sfCommandArgument objects.

  • (string) getBriefDescription () Browse code

    Returns the brief description for the task.

    returns The brief description for the task

  • (string) getDetailedDescription () Browse code

    Returns the detailed description for the task.


    It also formats special string like [...|COMMENT]
    depending on the current formatter.

    returns The detailed description for the task

  • (string) getFullName () Browse code

    Returns the fully qualified task name.

    returns The fully qualified task name

  • (string) getName () Browse code

    Returns the task name

    returns The task name

  • getNamespace () Browse code

    Returns the task namespace.

  • (sfCommandOption) getOptions () Browse code

    Returns the options objects.

    returns An array of sfCommandOption objects.

  • getSynopsis () Browse code

    Returns the synopsis for the task.

  • initialize ($dispatcher, $formatter) Browse code

    $dispatcher A sfEventDispatcher instance
    $formatter A sfFormatter instance

    Initializes the sfTask instance.

  • log ($messages) Browse code

    $messages The message as an array of lines of a single string

    Logs a message.

  • logSection ($section, $message, $size, $style) Browse code

    $section The section name
    $message The message
    $size The maximum size of a line
    $style The color scheme to apply to the section string (INFO, ERROR, or COMMAND)

    Logs a message in a section.

  • process () Browse code

  • (integer) run ($arguments, $options) Browse code

    $arguments An array of arguments
    $options An array of options

    Runs the task.

    returns 0 if everything went fine, or an error code

  • (integer) runFromCLI ($commandManager, $options) Browse code

    $commandManager An sfCommandManager instance
    $options The command line options

    Runs the task from the CLI.

    returns 0 if everything went fine, or an error code

  • __construct ($dispatcher, $formatter) Browse code

    $dispatcher An sfEventDispatcher instance
    $formatter An sfFormatter instance

    Constructor.