symfony API

sfCommandApplication Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

Packages

You are currently browsing the symfony API for the 1.2 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.

sfCommandApplication manages the lifecycle of a CLI application.

Inheritence

sfSymfonyCommandApplication  <  sfCommandApplication

Method Summary

  • configure()
    Configures the current command application.
  • fixCgi()
    Fixes php behavior if using cgi php.
  • getAbbreviations($names)
    Returns an array of possible abbreviations given a set of names.
  • object The getFormatter()
    Returns the formatter instance.
  • string getLongVersion()
    Returns the long version of the application.
  • string getName()
    Gets the name of the application.
  • mixed getOption($name)
    Returns the value of a given option.
  • getTask($name)
    Returns a registered task by name or alias.
  • array getTasks()
    Returns all registered tasks.
  • getTaskToExecute($name)
    Gets a task from a task name or a shortcut.
  • string getVersion()
    Gets the application version.
  • handleOptions($options = null)
    Parses and handles command line options.
  • help()
    Outputs a help message for the current application.
  • isDryrun()
  • Boolean isVerbose()
    Returns whether the application must be verbose.
  • registerTask($task)
    Registers a task object.
  • registerTasks($tasks = null)
    Registers an array of task objects.
  • renderException((Exception) $e)
    Renders an exception.
  • integer run($options = null)
    Runs the current application.
  • setName($name)
    Sets the application name.
  • setVersion($version)
    Sets the application version.
  • strlen($string)
  • Boolean withTrace()
    Returns whether the application must activate the trace.
  • __construct($dispatcher, $formatter, $options = array())
    Constructor.

Method Details

  • configure ()

    Configures the current command application.

  • fixCgi ()

    Fixes php behavior if using cgi php.

  • getAbbreviations ($names)

    $names

    Returns an array of possible abbreviations given a set of names.

  • (object The) getFormatter ()

    Returns the formatter instance.

    returns formatter instance

  • (string) getLongVersion ()

    Returns the long version of the application.

    returns The long application version

  • (string) getName ()

    Gets the name of the application.

    returns The application name

  • (mixed) getOption ($name)

    $name The option name

    Returns the value of a given option.

    returns The option value

  • getTask ($name)

    $name The task name or alias

    Returns a registered task by name or alias.

    returns An sfTask object

  • (array) getTasks ()

    Returns all registered tasks.

    returns An array of sfTask objects

  • getTaskToExecute ($name)

    $name The task name or a task shortcut

    Gets a task from a task name or a shortcut.

    returns A sfTask object

  • (string) getVersion ()

    Gets the application version.

    returns The application version

  • handleOptions ($options = null)

    $options The command line options

    Parses and handles command line options.

  • help ()

    Outputs a help message for the current application.

  • isDryrun ()

  • (Boolean) isVerbose ()

    Returns whether the application must be verbose.

    returns true if the application must be verbose, false otherwise

  • registerTask ($task)

    $task An sfTask object

    Registers a task object.

  • registerTasks ($tasks = null)

    $tasks An array of tasks

    Registers an array of task objects.


    If you pass null, this method will register all available tasks.

  • renderException ((Exception) $e)

    $e An exception object

    Renders an exception.

  • (integer) run ($options = null)

    $options The command line options

    Runs the current application.

    returns 0 if everything went fine, or an error code

  • setName ($name)

    $name The application name

    Sets the application name.

  • setVersion ($version)

    $version The application version

    Sets the application version.

  • strlen ($string)

    $string

  • (Boolean) withTrace ()

    Returns whether the application must activate the trace.

    returns true if the application must activate the trace, false otherwise

  • __construct ($dispatcher, $formatter, $options = array())

    $dispatcher A sfEventDispatcher instance
    $formatter A sfFormatter instance
    $options An array of options

    Constructor.