protected function configure()
    {
        $this->addOptions(array(new sfCommandOption('application', null, sfCommandOption::PARAMETER_OPTIONAL, 'The application name', sfSympalToolkit::getDefaultApplication()), new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'), new sfCommandOption('search', null, sfCommandOption::PARAMETER_OPTIONAL, 'Search for a sympal plugin.')));
        $this->aliases = array();
        $this->namespace = 'sympal';
        $this->name = 'plugin-list';
        $this->briefDescription = 'List/search through all the available sympal plugins.';
        $this->detailedDescription = <<<EOF
The [sympal:plugin-list|INFO] is a task to list all the available sympal plugins.
EOF;
    }
    protected function configure()
    {
        $this->addArguments(array(new sfCommandArgument('name', sfCommandArgument::REQUIRED, 'The name of the functionality. i.e. sfSympal#NAME#Plugin')));
        $this->addOptions(array(new sfCommandOption('content-type', null, sfCommandOption::PARAMETER_OPTIONAL, 'The name of the content type to create', null), new sfCommandOption('application', null, sfCommandOption::PARAMETER_OPTIONAL, 'The application name', sfSympalToolkit::getDefaultApplication()), new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'), new sfCommandOption('no-confirmation', null, sfCommandOption::PARAMETER_NONE, 'Do not ask for confirmation')));
        $this->aliases = array();
        $this->namespace = 'sympal';
        $this->name = 'plugin-install';
        $this->briefDescription = 'Install a sympal plugin to an existing sympal installation';
        $this->detailedDescription = <<<EOF
The [sympal:plugin-install|INFO] is a task to install a plugin to an existing sympal installation.
EOF;
    }
    protected function configure()
    {
        $this->addArguments(array(new sfCommandArgument('name', sfCommandArgument::OPTIONAL, 'The name of the functionality. i.e. sfSympal#NAME#Plugin')));
        $this->addOptions(array(new sfCommandOption('application', null, sfCommandOption::PARAMETER_OPTIONAL, 'The application name', sfSympalToolkit::getDefaultApplication()), new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'), new sfCommandOption('list-available', null, sfCommandOption::PARAMETER_NONE, 'List the available sympal plugins.')));
        $this->aliases = array();
        $this->namespace = 'sympal';
        $this->name = 'plugin-download';
        $this->briefDescription = 'Download a sympal plugin to an existing sympal installation';
        $this->detailedDescription = <<<EOF
The [sympal:plugin-download|INFO] is a task to download a plugin to an existing sympal installation.
EOF;
    }
    protected function configure()
    {
        $this->addOptions(array(new sfCommandOption('application', null, sfCommandOption::PARAMETER_OPTIONAL, 'The application', sfSympalToolkit::getDefaultApplication()), new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'), new sfCommandOption('no-confirmation', null, sfCommandOption::PARAMETER_NONE, 'Do not ask for confirmation'), new sfCommandOption('download-new', null, sfCommandOption::PARAMETER_NONE, 'Check if a new version exists on the web and download it first before running the upgrade tasks.')));
        $this->aliases = array();
        $this->namespace = 'sympal';
        $this->name = 'upgrade';
        $this->briefDescription = 'Upgrade a Sympal project by running any new upgrade tasks.';
        $this->detailedDescription = <<<EOF
The [symfony sympal:upgrade|INFO] task upgrades a Sympal project by running any new upgrade tasks.

  [./symfony sympal:upgrade|INFO]
EOF;
    }
    protected function configure()
    {
        $this->addOptions(array(new sfCommandOption('application', null, sfCommandOption::PARAMETER_OPTIONAL, 'The application name', sfSympalToolkit::getDefaultApplication()), new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev')));
        $this->aliases = array();
        $this->namespace = 'sympal';
        $this->name = 'report-statistics';
        $this->briefDescription = 'Report statistics back to Symfony';
        $this->detailedDescription = <<<EOF
The [sympal:report-statistics|INFO] task reports some statistics back to Symfony.
Like what plugins you are using, versions, etc.

  [./sympal:report-statistics|INFO]
EOF;
    }
    protected function configure()
    {
        $this->addArguments(array(new sfCommandArgument('content-type', sfCommandArgument::REQUIRED, 'The model name to purge the data into.')));
        $this->addOptions(array(new sfCommandOption('application', null, sfCommandOption::PARAMETER_OPTIONAL, 'The application name', sfSympalToolkit::getDefaultApplication()), new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev')));
        $this->aliases = array();
        $this->namespace = 'sympal';
        $this->name = 'purge-content';
        $this->briefDescription = 'Purge the content for the specified content type.';
        $this->detailedDescription = <<<EOF
The [sympal:purge-content|INFO] task purges the content for the specified type.

  [./symfony sympal:purge-content Page|INFO]
EOF;
    }
    protected function configure()
    {
        $this->addArguments(array(new sfCommandArgument('database', sfCommandArgument::REQUIRED, 'The database to import content from.'), new sfCommandArgument('table', sfCommandArgument::REQUIRED, 'The table in the database to import content from.'), new sfCommandArgument('model', sfCommandArgument::REQUIRED, 'The model name to import the data into.')));
        $this->addOptions(array(new sfCommandOption('application', null, sfCommandOption::PARAMETER_OPTIONAL, 'The application name', sfSympalToolkit::getDefaultApplication()), new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev')));
        $this->aliases = array();
        $this->namespace = 'sympal';
        $this->name = 'import-content';
        $this->briefDescription = 'Import Sympal content from a table in a database';
        $this->detailedDescription = <<<EOF
The [sympal:import-content|INFO] task reports some statistics back to Symfony.
Like what plugins you are using, versions, etc.

  [./symfony sympal:import-content my_database the_table MyContentType|INFO]
EOF;
    }
    protected function configure()
    {
        $this->addOptions(array(new sfCommandOption('application', null, sfCommandOption::PARAMETER_OPTIONAL, 'The application', sfSympalToolkit::getDefaultApplication()), new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'), new sfCommandOption('check', null, sfCommandOption::PARAMETER_NONE, 'Check for new versions.')));
        $this->aliases = array();
        $this->namespace = 'sympal';
        $this->name = 'version';
        $this->briefDescription = 'Show the current Sympal version and check for new versions.';
        $this->detailedDescription = <<<EOF
The [symfony sympal:version|INFO] task outputs the current Sympal version.

  [./symfony sympal:version|INFO]

You can also check for new versions:

  [./symfony sympal:version --check|INFO]
EOF;
    }
    protected function configure()
    {
        $this->addOptions(array(new sfCommandOption('application', null, sfCommandOption::PARAMETER_OPTIONAL, 'The application', sfSympalToolkit::getDefaultApplication()), new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'), new sfCommandOption('all', null, sfCommandOption::PARAMETER_NONE, 'Index all applications')));
        $this->aliases = array();
        $this->namespace = 'sympal';
        $this->name = 'build-search-index';
        $this->briefDescription = 'Build the Sympal search index';
        $this->detailedDescription = <<<EOF
The [symfony sympal:build-search-index|INFO] task builds the search index for the first Sympal site found in the applications directory.

  [./symfony sympal:build-search-index|INFO]

You can optionally specify an option to build all sites:

  [./symfony sympal:build-search-index --all|INFO]

Or you can build the index for a specific site:

  [./symfony sympal:build-search-index --application=another_site|INFO]
EOF;
    }
    protected function configure()
    {
        $this->addArguments(array(new sfCommandArgument('application', sfCommandArgument::OPTIONAL, 'The application to install sympal in.', sfSympalToolkit::getDefaultApplication())));
        $this->addOptions(array(new sfCommandOption('email', null, sfCommandOption::PARAMETER_OPTIONAL, 'The e-mail address of the first user to create', '*****@*****.**'), new sfCommandOption('username', null, sfCommandOption::PARAMETER_OPTIONAL, 'The username of the first user to create.', 'admin'), new sfCommandOption('password', null, sfCommandOption::PARAMETER_OPTIONAL, 'The password of the first user to create.', 'admin'), new sfCommandOption('first-name', null, sfCommandOption::PARAMETER_OPTIONAL, 'The first name of the first user to create.'), new sfCommandOption('last-name', null, sfCommandOption::PARAMETER_OPTIONAL, 'The last name of the first user to create.'), new sfCommandOption('no-confirmation', null, sfCommandOption::PARAMETER_NONE, 'Do not ask for confirmation'), new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev')));
        $this->aliases = array();
        $this->namespace = 'sympal';
        $this->name = 'install';
        $this->briefDescription = 'Install the sympal CMF into a blank symfony project';
        $this->detailedDescription = <<<EOF
The [./symfony sympal:install|INFO] task installs the sympal CMF into a blank symfony project:

  [./symfony sympal:install|INFO]

By default the task will find the first application in the apps folder and install 
sympal for that application. You can specify the application with the first argument.

  [./symfony sympal:install my_app|INFO]

To force a full reinstall of sympal use the force-reinstall option:

  [./symfony sympal:install --force-reinstall|INFO]
EOF;
    }
Exemple #11
0
<?php

$app = 'sympal';
require_once dirname(__FILE__) . '/../bootstrap/unit.php';
$t = new lime_test(5, new lime_output_color());
$sympalContext = sfSympalContext::getInstance();
$menuItem = Doctrine_Core::getTable('sfSympalMenuItem')->findOneBySlug('home');
$sympalContext->setCurrentMenuItem($menuItem);
$t->is($sympalContext->getCurrentMenuItem(), $menuItem);
$t->is($sympalContext->getSite()->getSlug(), $app);
$resource = sfSympalToolkit::getSymfonyResource('test', 'test', array('var' => 'Test'));
$t->is($resource, 'Test');
$t->is(sfSympalToolkit::getDefaultApplication(), 'sympal');
$t->is(in_array('en', sfSympalToolkit::getAllLanguageCodes()), true);