- logger(sprintf('Cannot notify administrators about update_id=%d, error_message=%s', $update_id, $error_message), LOGGER_WARNING);
+ logger(sprintf('Cannot notify administrators about update_id=%d, error_message=%s', $update_id, $error_message), LOGGER_NORMAL);
$email_tpl = get_intltext_template("update_fail_eml.tpl");
$email_msg = replace_macros($email_tpl, array(
'$sitename' => $a->config['sitename'],
$email_tpl = get_intltext_template("update_fail_eml.tpl");
$email_msg = replace_macros($email_tpl, array(
'$sitename' => $a->config['sitename'],
'$update' => DB_UPDATE_VERSION,
'$error' => sprintf(t('Update %s failed. See error logs.'), DB_UPDATE_VERSION)
));
'$update' => DB_UPDATE_VERSION,
'$error' => sprintf(t('Update %s failed. See error logs.'), DB_UPDATE_VERSION)
));
require_once('include/email.php');
$subject = email_header_encode($subject,'UTF-8');
mail($a->config['admin_email'], $subject, $email_msg,
require_once('include/email.php');
$subject = email_header_encode($subject,'UTF-8');
mail($a->config['admin_email'], $subject, $email_msg,
// On utf8mb4 a varchar index can only have a length of 191
// The "show index" command sometimes returns this value although this value wasn't added manually.
// Because we don't want to add this number to every index, we ignore bigger numbers
// On utf8mb4 a varchar index can only have a length of 191
// The "show index" command sometimes returns this value although this value wasn't added manually.
// Because we don't want to add this number to every index, we ignore bigger numbers
return t('Errors encountered performing database changes: ').$message.EOL;
}
function update_structure($verbose, $action, $tables=null, $definition=null) {
return t('Errors encountered performing database changes: ').$message.EOL;
}
function update_structure($verbose, $action, $tables=null, $definition=null) {
- if ((version_compare($db->server_info(), '5.7.4') >= 0) AND
- !(strpos($db->server_info(), 'MariaDB') !== false)) {
+ if ((version_compare(dba::server_info(), '5.7.4') >= 0) &&
+ !(strpos(dba::server_info(), 'MariaDB') !== false)) {
if (!isset($database[$name])) {
$r = db_create_table($name, $structure["fields"], $verbose, $action, $structure['indexes']);
if (!dbm::is_result($r)) {
if (!isset($database[$name])) {
$r = db_create_table($name, $structure["fields"], $verbose, $action, $structure['indexes']);
if (!dbm::is_result($r)) {
$field_definition = $database[$name]["fields"][$fieldname];
// Define the default collation if not given
$field_definition = $database[$name]["fields"][$fieldname];
// Define the default collation if not given
if ($field_definition['Collation'] != $parameters['Collation']) {
$sql2 = db_modify_table_field($fieldname, $parameters);
if ($field_definition['Collation'] != $parameters['Collation']) {
$sql2 = db_modify_table_field($fieldname, $parameters);
$fieldstruct .= " PRIMARY KEY";*/
return($fieldstruct);
}
function db_create_table($name, $fields, $verbose, $action, $indexes=null) {
$fieldstruct .= " PRIMARY KEY";*/
return($fieldstruct);
}
function db_create_table($name, $fields, $verbose, $action, $indexes=null) {
$primary_keys = array();
foreach ($fields AS $fieldname => $field) {
$sql_rows[] = "`".dbesc($fieldname)."` ".db_field_command($field);
$primary_keys = array();
foreach ($fields AS $fieldname => $field) {
$sql_rows[] = "`".dbesc($fieldname)."` ".db_field_command($field);
"uid_created" => array("uid","created"),
"uid_commented" => array("uid","commented"),
"uid_wall_created" => array("uid","wall","created"),
"uid_created" => array("uid","created"),
"uid_commented" => array("uid","commented"),
"uid_wall_created" => array("uid","wall","created"),
"created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE),
"pid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"executed" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE),
"created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE),
"pid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"executed" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE),
- if (is_null($db)) {
- @include(".htconfig.php");
- require_once("include/dba.php");
- $db = new dba($db_host, $db_user, $db_pass, $db_data);
- unset($db_host, $db_user, $db_pass, $db_data);
- }
+ @include ".htconfig.php";
+ require_once "include/dba.php";
+ dba::connect($db_host, $db_user, $db_pass, $db_data);
+ unset($db_host, $db_user, $db_pass, $db_data);