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>'); } }
} 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);
<?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);
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);