本文整理汇总了PHP中Installer::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Installer::update方法的具体用法?PHP Installer::update怎么用?PHP Installer::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Installer
的用法示例。
在下文中一共展示了Installer::update方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
protected function execute(InputInterface $input, OutputInterface $output)
{
$autoRegister = $input->getOption('auto-register');
$installer = new \Installer();
$installed = $installer->tableExists('users_users');
if ($installed) {
$installer->update();
$output->writeln('Update completed.');
if (count($installer->installed)) {
foreach ($installer->installed as $patch) {
$output->writeln("<info>Installed: {$patch}</info>");
}
}
if (count($installer->executed)) {
foreach ($installer->executed as $script) {
$output->writeln("<info>Executed: {$script}</info>");
}
}
$output->writeln('<info>Queries executed successfully: ' . count($installer->success) . '</info>');
if (count($installer->failures)) {
foreach ($installer->failures as $key => $error) {
list($query, $message, $patch) = $error;
$output->writeln("<error>Error {$key} in {$patch}\n\t{$query}\n\t{$message}</error>");
if ($autoRegister) {
$installer->recordPatch($patch);
}
}
}
$cachelib = \TikiLib::lib('cache');
$cachelib->empty_cache();
} else {
$output->writeln('<error>Database not found.</error>');
}
}
示例2: TikiLib
}
TikiDb::set($db);
global $tikilib;
require_once 'lib/tikilib.php';
$tikilib = new TikiLib();
// update db if needed
require_once 'lib/init/initlib.php';
include_once 'installer/installlib.php';
$installer = new Installer();
if (!$installer->tableExists('tiki_preferences')) {
echo "Installing Tiki database...\n";
$installer->cleanInstall();
} else {
if ($installer->requiresUpdate()) {
echo "Updating Tiki database...\n";
$installer->update();
}
}
$pwd = getcwd();
chdir(dirname(__FILE__) . '/../..');
$smarty = TikiLib::lib('smarty');
require_once 'lib/init/smarty.php';
$smarty->addPluginsDir('../smarty_tiki/');
$cachelib = TikiLib::lib('cache');
$wikilib = TikiLib::lib('wiki');
$userlib = TikiLib::lib('user');
$headerlib = TikiLib::lib('header');
require_once 'lib/init/tra.php';
$access = TikiLib::lib('access');
$_SESSION = array('u_info' => array('login' => null));
chdir($pwd);
示例3: Installer
<?php
/**
* Part of ci-phpunit-test
*
* @author Kenji Suzuki <https://github.com/kenjis>
* @license MIT License
* @copyright 2015 Kenji Suzuki
* @link https://github.com/kenjis/ci-phpunit-test
*/
require __DIR__ . '/Installer.php';
$app = 'application';
if (isset($argv[1]) && is_dir($argv[1])) {
$app = $argv[1];
}
$installer = new Installer();
$installer->update($app);
示例4: implode
logMessage(L_USER, 'HTML5_VERSION is: ' . $latestVersions["HTML5_VERSION"]);
// init the application configuration
$app->initFromUserInput(array_merge((array) $user->getAll(), (array) $latestVersions));
$db_params['db_host'] = $app->get('DB1_HOST');
$db_params['db_port'] = $app->get('DB1_PORT');
$db_params['db_user'] = $app->get('DB1_USER');
$db_params['db_pass'] = $app->get('DB1_PASS');
// verify prerequisites
echo PHP_EOL;
logMessage(L_USER, "Verifing prerequisites");
@exec(sprintf("%s installer/Prerequisites.php '%s' '%s' '%s' '%s' '%s' 2>&1", $app->get("PHP_BIN"), $app->get("HTTPD_BIN"), $db_params['db_host'], $db_params['db_port'], $db_params['db_user'], $db_params['db_pass']), $output, $exit_value);
if ($exit_value !== 0) {
$description = " " . implode("\n ", $output) . "\n";
echo PHP_EOL;
logMessage(L_USER, "One or more prerequisites required to install Kaltura failed:" . $description . "Please resolve the issues and run the installation again.");
die(1);
}
// last chance to stop
echo PHP_EOL;
if (!$silentRun && !$user->getTrueFalse('', "Start update now?", 'y')) {
echo "Bye" . PHP_EOL;
die(1);
}
// run the installation
$install_output = $installer->update($app, $db_params);
if ($install_output !== null) {
logMessage(L_USER, "Update failed." . $install_output . $fail_action);
}
echo PHP_EOL;
logMessage(L_USER, "Update Completed Successfully.\n");
die(0);