本文整理汇总了PHP中opToolkit::createStringDsnFromArray方法的典型用法代码示例。如果您正苦于以下问题:PHP opToolkit::createStringDsnFromArray方法的具体用法?PHP opToolkit::createStringDsnFromArray怎么用?PHP opToolkit::createStringDsnFromArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类opToolkit
的用法示例。
在下文中一共展示了opToolkit::createStringDsnFromArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
protected function execute($arguments = array(), $options = array())
{
if (!isset($options['origin'])) {
$options['origin'] = '2.12';
}
if (!in_array($options['origin'], array('2.12', '2.14', '3.4'))) {
throw new RuntimeException('You must specify "2.12", "2.14" or "3.4" to the --origin option. (--origin オプションには 2.12、 2.14 または 3.4 を指定してください。)');
}
sfConfig::set('op_upgrade2_version', $options['origin']);
$op2config = sfConfig::get('sf_config_dir') . DIRECTORY_SEPARATOR . 'config.OpenPNE2.php';
if (!is_readable($op2config)) {
throw new RuntimeException('You must copy the config.php in your OpenPNE2 as config/config.OpenPNE2.php. (お使いの OpenPNE2 の config.php を config/config.OpenPNE2.php としてコピーしてください。)');
}
if (!defined('OPENPNE_DIR')) {
define('OPENPNE_DIR', sfConfig::get('sf_root_dir'));
}
require_once $op2config;
$this->runTask('configure:database', array(opToolkit::createStringDsnFromArray($GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']), $GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']['username'], empty($GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']['password']) ? null : $GLOBALS['_OPENPNE_DSN_LIST']['main']['dsn']['password']));
$path = sfConfig::get('sf_data_dir') . DIRECTORY_SEPARATOR . 'upgrade' . DIRECTORY_SEPARATOR . '2';
$upgrader = new opUpgrader($this->dispatcher, $this->formatter, $path, $this->configuration);
if ($options['rules']) {
$upgrader->setOption('targets', $options['rules']);
}
if ('3.4' === $options['origin']) {
$upgrader->setDefinitionName('definition-34to36.yml');
}
$this->logSection('upgrade', 'Begin upgrading from 2.x');
$upgrader->execute();
$task = new sfPluginPublishAssetsTask($this->dispatcher, $this->formatter);
$task->run(array(), array());
}