symfony API

sfBaseTask 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.4 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.

Base class for all symfony tasks.

Method Summary

Methods inherited from sfCommandApplicationTask

createTask , getMailer , getRouting , initializeMailer , initializeRouting , log , logSection , runTask , setCommandApplication

Methods inherited from sfTask

addArgument , addArguments , addOption , addOptions , ask , askAndValidate , askConfirmation , asXml , configure , doRun , execute , getAliases , getArguments , getBriefDescription , getDetailedDescription , getFormatter , getFullName , getName , getNamespace , getOptions , getSynopsis , initialize , log , logBlock , logSection , process , run , runFromCLI , setFormatter , strlen , __construct

Method Details

  • (bool) checkAppExists ($app)

    $app The application name

    Checks if an application exists.

    returns true if the application exists, false otherwise

  • (bool) checkModuleExists ($app, $module)

    $app The application name
    $module The module name

    Checks if a module exists.

    returns true if the module exists, false otherwise

  • (true) checkProjectExists ()

    Checks if the current directory is a symfony project directory.

    returns if the current directory is a symfony project directory, false otherwise

  • (sfProjectConfiguration) createConfiguration ($application, $env)

    $application The application name
    $env The environment name

    Creates a configuration object.

    returns A sfProjectConfiguration instance

  • createTask ()

    @see sfCommandApplicationTask

  • disablePlugin ($plugin)

    $plugin The name of the plugin

    Disables a plugin in the ProjectConfiguration class.

  • doRun ()

    @see sfTask

  • enablePlugin ($plugin)

    $plugin The name of the plugin

    Enables a plugin in the ProjectConfiguration class.

  • (sfFilesystem) getFilesystem ()

    Returns the filesystem instance.

    returns A sfFilesystem instance

  • (string) getFirstApplication ()

    Returns the first application in apps.

    returns The Application name

  • (sfSymfonyPluginManager) getPluginManager ()

    Returns a plugin manager instance.

    returns A sfSymfonyPluginManager instance

  • initializeAutoload ($configuration, $reload)

    $configuration The current project or application configuration
    $reload If true, all autoloaders will be reloaded

    Initializes autoloaders.

  • installDir ($dir, $finder)

    $dir The directory to mirror
    $finder A sfFinder instance to use for the mirroring

    Mirrors a directory structure inside the created project.

  • reloadAutoload ()

    Reloads all autoloaders.


    This method should be called whenever a task generates new classes that
    are to be loaded by the symfony autoloader. It clears the autoloader
    cache for all applications and environments and the current execution.

  • reloadTasks ()

    Reloads tasks.


    Useful when you install plugins with tasks and if you want to use them with the runTask() method.

  • replaceTokens ($dirs, $tokens)

    $dirs An array of directory where to do the replacement
    $tokens An array of tokens to use

    Replaces tokens in files contained in a given directory.


    If you don't pass a directory, it will replace in the config/ and lib/ directory.

    You can define global tokens by defining the $this->tokens property.

  • setConfiguration ($configuration)

    Sets the current task's configuration.