Skip to content

Instantly share code, notes, and snippets.

@tejima
Created May 23, 2011 04:29
Show Gist options
  • Save tejima/986223 to your computer and use it in GitHub Desktop.
Save tejima/986223 to your computer and use it in GitHub Desktop.
Skip Interactive Install
<?php
/**
* Mamoru Tejima
*/
class openpneSIInstallTask extends openpneInstallTask
{
protected function configure()
{
$this->namespace = 'openpne';
$this->name = 'siinstall';
$this->addArgument('dbms', sfCommandArgument::REQUIRED, 'dbms');
$this->addArgument('username', sfCommandArgument::REQUIRED, 'username');
$this->addArgument('password', sfCommandArgument::REQUIRED, 'password');
$this->addArgument('hostname', sfCommandArgument::REQUIRED, 'hostname');
$this->addArgument('port', sfCommandArgument::REQUIRED, 'port');
$this->addArgument('dbname', sfCommandArgument::REQUIRED, 'dbname');
$this->addArgument('sock', sfCommandArgument::OPTIONAL, 'sock');
$this->addOptions(array(
new sfCommandOption('application', null, sfCommandOption::PARAMETER_OPTIONAL, 'The application name', null),
new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'prod'),
new sfCommandOption('redo', null, sfCommandOption::PARAMETER_NONE, 'Executes a reinstall'),
new sfCommandOption('non-recreate-db', null, sfCommandOption::PARAMETER_NONE, 'Non recreate DB'),
new sfCommandOption('standalone', null, sfCommandOption::PARAMETER_NONE, 'Standalone install'),
new sfCommandOption('sqlite', null, sfCommandOption::PARAMETER_NONE, 'SQLite mode'),
));
$this->briefDescription = 'Install OpenPNE';
$this->detailedDescription = <<<EOF
The [openpne:install|INFO] task installs and configures OpenPNE.
Call it with:
[./symfony openpne:install|INFO]
EOF;
}
protected function execute($arguments = array(), $options = array())
{
$this->doInstall($arguments['dbms'], $arguments['username'], $arguments['password'], $arguments['hostname'], $arguments['port'], $arguments['dbname'], $arguments['sock'], $options);
$this->publishAssets();
// _PEAR_call_destructors() causes an E_STRICT error
error_reporting(error_reporting() & ~E_STRICT);
$this->logSection('installer', 'installation is completed!');
}
}
?>
@tejima
Copy link
Author

tejima commented May 23, 2011

■設置
/lib/task 以下に本ファイルを設置

■実行
./symfony openpne:siinstall DBMS USERNAME PASSWORD HOST PORT DBNAME

./symfony openpne:siinstall mysql tejima tejima'spass localhost 3306 tejima_db_name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment