/**
     * @see sfTask
     */
    protected function configure()
    {
        parent::configure();
        $this->addArguments(array(new sfCommandArgument('dir_or_file', sfCommandArgument::REQUIRED | sfCommandArgument::IS_ARRAY, 'Directory or file to load')));
        $this->addOptions(array(new sfCommandOption('application', null, sfCommandOption::PARAMETER_OPTIONAL, 'The application name', true), new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'), new sfCommandOption('append', null, sfCommandOption::PARAMETER_NONE, 'Don\'t delete current data in the database'), new sfCommandOption('database', null, sfCommandOption::PARAMETER_OPTIONAL, 'The database to use'), new sfCommandOption('no-confirmation', null, sfCommandOption::PARAMETER_NONE, 'Whether to force dropping of the database')));
        $this->namespace = 'doctrine';
        $this->name = 'mysql-sql-load';
        $this->briefDescription = 'Loads MySQL queries from files/dir into a MySQL database';
        $this->detailedDescription = <<<EOF
The [doctrine:mysql-sql-load|INFO] is used to load SQL into a MySQL database,
it will not function on non MySQL databases:

  [./symfony doctrine:mysql-sql-load|INFO]

The intended function of this task is to load a MySQL dump backup of a database.

An argument of a target must be specified, mulitple files or a directory of .sql
can be specified.

If you don't want the task to drop and recreate the database and instead want to
just add to the existing database, use the
[--append|COMMENT] option:

  [./symfony doctrine:mysql-sql-load --append target|INFO]
EOF;
    }
コード例 #2
0
 protected function configure()
 {
     parent::configure();
     $this->addOptions(array(new sfCommandOption('application', null, sfCommandOption::PARAMETER_OPTIONAL, 'The application name', true), new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'prod'), new sfCommandOption('from', null, sfCommandOption::PARAMETER_REQUIRED, 'member id which start from (inclusive)', 1), new sfCommandOption('to', null, sfCommandOption::PARAMETER_REQUIRED, 'member id which end to (exclusive)', null), new sfCommandOption('header', null, sfCommandOption::PARAMETER_OPTIONAL, 'need to output csv param header', true)));
     $this->namespace = 'opCsvExport';
     $this->name = 'export';
 }
コード例 #3
0
    protected function configure()
    {
        parent::configure();
        $this->namespace = 'openpne';
        $this->name = 'friend-link';
        $this->briefDescription = '';
        $this->addOptions(array(new sfCommandOption('start-member-id', null, sfCommandOption::PARAMETER_OPTIONAL, 'Start member id', null), new sfCommandOption('end-member-id', null, sfCommandOption::PARAMETER_OPTIONAL, 'End member id', null)));
        $this->detailedDescription = <<<EOF
The [openpne:friend-link|INFO] task does things.
Call it with:

  [php symfony openpne:friend-link|INFO]
EOF;
    }