Esempio n. 1
0
 $cfg_db_inv_username = $configObject->get('cfg_db_inv_user');
 $cfg_use_ldap = $configObject->get('cfg_use_ldap');
 $cfg_web_host = $configObject->get('cfg_web_host');
 if ($cfg_web_host == '') {
     $cfg_web_host = $cfg_db_host;
 }
 error_reporting(-1);
 ob_start();
 echo "\n<blockquote>\n<h1>" . $string['startingupdate'] . "</h1>";
 echo "<div>Starting at " . date("H:i:s") . "</div>\n<ol>";
 ob_flush();
 flush();
 $mysqli->autocommit(false);
 // 01/05/2013 - Update the online help files.
 if (isset($_POST['update_staff_help'])) {
     $updater_utils->execute_query("TRUNCATE staff_help", true);
     $file = file_get_contents('../install/staff_help.sql');
     $mysqli->multi_query($file);
     if ($mysqli->error) {
         try {
             throw new Exception("MySQL error {$mysqli->error} <br /> Query:<br /> ", $mysqli->errno);
         } catch (Exception $e) {
             echo "Error No: " . $e->getCode() . " - " . $e->getMessage() . "<br />";
             echo nl2br($e->getTraceAsString());
             exit;
         }
     }
     $ext = '';
     while ($mysqli->more_results()) {
         $mysqli->next_result();
         if ($mysqli->insert_id > 0) {
Esempio n. 2
0
 $cfg_db_student_user = $configObject->get('cfg_db_student_user');
 $cfg_db_staff_user = $configObject->get('cfg_db_staff_user');
 $cfg_db_host = $configObject->get('cfg_db_host');
 $cfg_db_username = $configObject->get('cfg_db_username');
 $cfg_db_external_user = $configObject->get('cfg_db_external_user');
 $cfg_db_inv_username = $configObject->get('cfg_db_inv_user');
 $cfg_use_ldap = $configObject->get('cfg_use_ldap');
 $mysqli->autocommit(false);
 error_reporting(-1);
 ob_start();
 echo "<div>Starting at " . date("H:i:s") . "</div>";
 echo "\n<blockquote>\n<h1>" . $string['startingupdate'] . "</h1>\n<ol>";
 // 15/06/2011
 // Add index to improve performance for standards setting index page
 if (!$updater_utils->does_index_exist('ebel', 'SETTER_AND_DATE')) {
     $updater_utils->execute_query("ALTER TABLE ebel ADD INDEX SETTER_AND_DATE (setterID, date_set)", true);
 }
 // 16/06/2011
 if ($updater_utils->does_column_exist('log_late', 'year')) {
     $updater_utils->execute_query("ALTER TABLE log_late DROP COLUMN year", true);
     $updater_utils->execute_query("ALTER TABLE log_late DROP COLUMN student_grade", true);
     $updater_utils->execute_query("ALTER TABLE log_late DROP COLUMN ipaddress", true);
 }
 // 16/06/2011
 if (!$updater_utils->does_column_exist('sys_errors', 'fixed')) {
     $updater_utils->execute_query("ALTER TABLE sys_errors ADD COLUMN fixed datetime", true);
     $updater_utils->execute_query("ALTER TABLE sys_errors ADD COLUMN php_self text", true);
     $updater_utils->execute_query("ALTER TABLE sys_errors ADD COLUMN query_string text", true);
     $updater_utils->execute_query("ALTER TABLE sys_errors ADD COLUMN request_method enum('GET', 'HEAD', 'POST', 'PUT', 'DELETE')", true);
 }
 $mysqli->commit();