$admin_mail_list
);
+ // No valid result?
+ if (!dbm::is_result($adminlist)) {
+ logger(sprintf('Cannot notify administrators about update_id=%d, error_message=%s', $update_id, $error_message), LOGGER_WARNING);
+
+ // Don't continue
+ return;
+ }
+
// every admin could had different language
foreach ($adminlist as $admin) {
$email_tpl = get_intltext_template("update_fail_eml.tpl");
$email_msg = replace_macros($email_tpl, array(
'$sitename' => $a->config['sitename'],
- '$siteurl' => $a->get_baseurl(),
+ '$siteurl' => App::get_baseurl(),
'$update' => DB_UPDATE_VERSION,
'$error' => sprintf(t('Update %s failed. See error logs.'), DB_UPDATE_VERSION)
));
- $subject=sprintf(t('Update Error at %s'), $a->get_baseurl());
+ $subject=sprintf(t('Update Error at %s'), App::get_baseurl());
require_once('include/email.php');
$subject = email_header_encode($subject,'UTF-8');
mail($a->config['admin_email'], $subject, $email_msg,
$fielddata = array();
$indexdata = array();
- if (is_array($indexes))
+ if (dbm::is_result($indexes))
foreach ($indexes AS $index) {
if ($index["Index_type"] == "FULLTEXT")
continue;
$indexdata[$index["Key_name"]][] = $column;
}
- if (is_array($structures)) {
+ if (dbm::is_result($structures)) {
foreach($structures AS $field) {
$fielddata[$field["Field"]]["type"] = $field["Type"];
if ($field["Null"] == "NO")
foreach ($tables AS $table) {
$table = current($table);
+ logger(sprintf('updating structure for table %s ...', $table), LOGGER_DEBUG);
$database[$table] = table_structure($table);
}
$sql3="";
if (!isset($database[$name])) {
$r = db_create_table($name, $structure["fields"], $charset, $verbose, $action, $structure['indexes']);
- if(false === $r) {
+ if (!dbm::is_result($r)) {
$errors .= t('Errors encountered creating database tables.').$name.EOL;
}
$is_new_table = True;
if ($action) {
$r = @$db->q($sql3);
- if(false === $r)
+ if (dbm::is_result($r))
$errors .= t('Errors encountered performing database changes.').$sql3.EOL;
}
}
"uid" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"),
"password" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"language" => array("type" => "varchar(16)", "not null" => "1", "default" => ""),
+ "note" => array("type" => "text"),
),
"indexes" => array(
"PRIMARY" => array("id"),