X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=src%2FDatabase%2FDBStructure.php;h=6c4ceec48ede5247c9e857ee555624d52ab3893c;hb=1ef02bd36b4d3147bcf39e09ae6bbd665841a700;hp=3f4614b6c7fd7e073c436f530d07a7ceef2b86b3;hpb=610f017b28edc37212df6385126993f2dfc41f59;p=friendica.git diff --git a/src/Database/DBStructure.php b/src/Database/DBStructure.php index 3f4614b6c7..6c4ceec48e 100644 --- a/src/Database/DBStructure.php +++ b/src/Database/DBStructure.php @@ -5,20 +5,22 @@ namespace Friendica\Database; use Friendica\Core\Config; +use Friendica\Core\L10n; use Friendica\Database\DBM; use dba; -require_once "boot.php"; +require_once 'boot.php'; require_once 'include/dba.php'; require_once 'include/enotify.php'; -require_once "include/text.php"; +require_once 'include/text.php'; /** * @brief This class contain functions for the database management * * This class contains functions that doesn't need to know if pdo, mysqli or whatever is used. */ -class DBStructure { +class DBStructure +{ /* * Converts all tables from MyISAM to InnoDB */ @@ -27,7 +29,7 @@ class DBStructure { dbesc(dba::database_name())); if (!DBM::is_result($r)) { - echo t('There are no tables on MyISAM.')."\n"; + echo L10n::t('There are no tables on MyISAM.')."\n"; return; } @@ -68,14 +70,14 @@ class DBStructure { // every admin could had different language foreach ($adminlist as $admin) { $lang = (($admin['language'])?$admin['language']:'en'); - push_lang($lang); + L10n::pushLang($lang); - $preamble = deindent(t(" + $preamble = deindent(L10n::t(" The friendica developers released update %s recently, but when I tried to install it, something went terribly wrong. This needs to be fixed soon and I can't do it alone. Please contact a friendica developer if you can not help me on your own. My database might be invalid.")); - $body = t("The error message is\n[pre]%s[/pre]"); + $body = L10n::t("The error message is\n[pre]%s[/pre]"); $preamble = sprintf($preamble, $update_id); $body = sprintf($body, $error_message); @@ -186,10 +188,10 @@ class DBStructure { * @return string Error message */ private static function printUpdateError($message) { - echo sprintf(t("\nError %d occurred during database update:\n%s\n"), + echo L10n::t("\nError %d occurred during database update:\n%s\n", dba::errorNo(), dba::errorMessage()); - return t('Errors encountered performing database changes: ').$message.EOL; + return L10n::t('Errors encountered performing database changes: ').$message.EOL; } /** @@ -204,7 +206,7 @@ class DBStructure { public static function update($verbose, $action, array $tables = null, array $definition = null) { if ($action) { Config::set('system', 'maintenance', 1); - Config::set('system', 'maintenance_reason', sprintf(t(': Database update'), DBM::date().' '.date('e'))); + Config::set('system', 'maintenance_reason', L10n::t(': Database update', DBM::date().' '.date('e'))); } $errors = ''; @@ -454,7 +456,7 @@ class DBStructure { } if ($action) { - Config::set('system', 'maintenance_reason', sprintf(t('%s: updating %s table.'), DBM::date().' '.date('e'), $name)); + Config::set('system', 'maintenance_reason', L10n::t('%s: updating %s table.', DBM::date().' '.date('e'), $name)); // Ensure index conversion to unique removes duplicates if ($is_unique && ($temp_name != $name)) { @@ -1472,7 +1474,7 @@ class DBStructure { "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "pdesc" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0001-01-01", "comment" => ""], + "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => ""], "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], @@ -1684,7 +1686,7 @@ class DBStructure { "uid_created" => ["uid","created"], "uid_commented" => ["uid","commented"], "uid_wall_created" => ["uid","wall","created"], - "private_wall_commented" => ["private","wall","commented"], + "private_wall_origin_commented" => ["private","wall","origin","commented"], ] ]; $database["tokens"] = [ @@ -1708,6 +1710,7 @@ class DBStructure { "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""], "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "legacy_password" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the password hash double-hashed?"], "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], @@ -1733,7 +1736,8 @@ class DBStructure { "page-flags" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""], "account-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""], "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "pwdreset" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"], + "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"], "maxreq" => ["type" => "int", "not null" => "1", "default" => "10", "comment" => ""], "expire" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""], "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], @@ -1783,6 +1787,6 @@ class DBStructure { ] ]; - return($database); + return $database; } }