From cd29730f1f4bc5c6ce6c2448dded7b698a5f261f Mon Sep 17 00:00:00 2001 From: jdarwood007 Date: Sun, 5 Nov 2023 10:07:12 -0800 Subject: [PATCH 01/35] Move our languages directory --- .../languages => Languages}/Admin.english.php | 0 .../Agreement.english.php | 0 .../Alerts.english.php | 0 .../Drafts.english.php | 0 .../Editor.english.php | 0 .../EmailTemplates.english.php | 0 .../Errors.english.php | 0 .../languages => Languages}/Help.english.php | 0 .../Install.english.php | 0 .../languages => Languages}/Login.english.php | 0 .../ManageBoards.english.php | 0 .../ManageCalendar.english.php | 0 .../ManageMail.english.php | 0 .../ManageMaintenance.english.php | 0 .../ManageMembers.english.php | 0 .../ManagePaid.english.php | 0 .../ManagePermissions.english.php | 0 .../ManageScheduledTasks.english.php | 0 .../ManageSettings.english.php | 2 +- .../ManageSmileys.english.php | 0 .../Manual.english.php | 0 .../ModerationCenter.english.php | 0 .../Modifications.english.php | 0 .../Modlog.english.php | 0 .../Packages.english.php | 0 .../PersonalMessage.english.php | 0 .../languages => Languages}/Post.english.php | 0 .../Profile.english.php | 0 .../Reports.english.php | 0 .../Search.english.php | 0 .../languages => Languages}/Stats.english.php | 0 .../Themes.english.php | 0 .../Timezones.english.php | 0 .../languages => Languages}/Who.english.php | 0 .../languages => Languages}/index.english.php | 0 Languages/index.php | 9 +++++ Sources/Actions/Admin/Languages.php | 22 ++++++++---- Sources/Actions/Admin/Themes.php | 2 +- Sources/Config.php | 35 ++++++++++++++++--- Sources/Lang.php | 3 ++ ...s.english.php => ThemeStrings.english.php} | 0 other/Settings.php | 8 +++++ other/Settings_bak.php | 8 +++++ other/install.php | 13 +++---- other/update_version_numbers.php | 2 +- other/upgrade.php | 32 ++++++++--------- 46 files changed, 99 insertions(+), 37 deletions(-) rename {Themes/default/languages => Languages}/Admin.english.php (100%) rename {Themes/default/languages => Languages}/Agreement.english.php (100%) rename {Themes/default/languages => Languages}/Alerts.english.php (100%) rename {Themes/default/languages => Languages}/Drafts.english.php (100%) rename {Themes/default/languages => Languages}/Editor.english.php (100%) rename {Themes/default/languages => Languages}/EmailTemplates.english.php (100%) rename {Themes/default/languages => Languages}/Errors.english.php (100%) rename {Themes/default/languages => Languages}/Help.english.php (100%) rename {Themes/default/languages => Languages}/Install.english.php (100%) rename {Themes/default/languages => Languages}/Login.english.php (100%) rename {Themes/default/languages => Languages}/ManageBoards.english.php (100%) rename {Themes/default/languages => Languages}/ManageCalendar.english.php (100%) rename {Themes/default/languages => Languages}/ManageMail.english.php (100%) rename {Themes/default/languages => Languages}/ManageMaintenance.english.php (100%) rename {Themes/default/languages => Languages}/ManageMembers.english.php (100%) rename {Themes/default/languages => Languages}/ManagePaid.english.php (100%) rename {Themes/default/languages => Languages}/ManagePermissions.english.php (100%) rename {Themes/default/languages => Languages}/ManageScheduledTasks.english.php (100%) rename {Themes/default/languages => Languages}/ManageSettings.english.php (99%) rename {Themes/default/languages => Languages}/ManageSmileys.english.php (100%) rename {Themes/default/languages => Languages}/Manual.english.php (100%) rename {Themes/default/languages => Languages}/ModerationCenter.english.php (100%) rename {Themes/default/languages => Languages}/Modifications.english.php (100%) rename {Themes/default/languages => Languages}/Modlog.english.php (100%) rename {Themes/default/languages => Languages}/Packages.english.php (100%) rename {Themes/default/languages => Languages}/PersonalMessage.english.php (100%) rename {Themes/default/languages => Languages}/Post.english.php (100%) rename {Themes/default/languages => Languages}/Profile.english.php (100%) rename {Themes/default/languages => Languages}/Reports.english.php (100%) rename {Themes/default/languages => Languages}/Search.english.php (100%) rename {Themes/default/languages => Languages}/Stats.english.php (100%) rename {Themes/default/languages => Languages}/Themes.english.php (100%) rename {Themes/default/languages => Languages}/Timezones.english.php (100%) rename {Themes/default/languages => Languages}/Who.english.php (100%) rename {Themes/default/languages => Languages}/index.english.php (100%) create mode 100644 Languages/index.php rename Themes/default/languages/{Settings.english.php => ThemeStrings.english.php} (100%) diff --git a/Themes/default/languages/Admin.english.php b/Languages/Admin.english.php similarity index 100% rename from Themes/default/languages/Admin.english.php rename to Languages/Admin.english.php diff --git a/Themes/default/languages/Agreement.english.php b/Languages/Agreement.english.php similarity index 100% rename from Themes/default/languages/Agreement.english.php rename to Languages/Agreement.english.php diff --git a/Themes/default/languages/Alerts.english.php b/Languages/Alerts.english.php similarity index 100% rename from Themes/default/languages/Alerts.english.php rename to Languages/Alerts.english.php diff --git a/Themes/default/languages/Drafts.english.php b/Languages/Drafts.english.php similarity index 100% rename from Themes/default/languages/Drafts.english.php rename to Languages/Drafts.english.php diff --git a/Themes/default/languages/Editor.english.php b/Languages/Editor.english.php similarity index 100% rename from Themes/default/languages/Editor.english.php rename to Languages/Editor.english.php diff --git a/Themes/default/languages/EmailTemplates.english.php b/Languages/EmailTemplates.english.php similarity index 100% rename from Themes/default/languages/EmailTemplates.english.php rename to Languages/EmailTemplates.english.php diff --git a/Themes/default/languages/Errors.english.php b/Languages/Errors.english.php similarity index 100% rename from Themes/default/languages/Errors.english.php rename to Languages/Errors.english.php diff --git a/Themes/default/languages/Help.english.php b/Languages/Help.english.php similarity index 100% rename from Themes/default/languages/Help.english.php rename to Languages/Help.english.php diff --git a/Themes/default/languages/Install.english.php b/Languages/Install.english.php similarity index 100% rename from Themes/default/languages/Install.english.php rename to Languages/Install.english.php diff --git a/Themes/default/languages/Login.english.php b/Languages/Login.english.php similarity index 100% rename from Themes/default/languages/Login.english.php rename to Languages/Login.english.php diff --git a/Themes/default/languages/ManageBoards.english.php b/Languages/ManageBoards.english.php similarity index 100% rename from Themes/default/languages/ManageBoards.english.php rename to Languages/ManageBoards.english.php diff --git a/Themes/default/languages/ManageCalendar.english.php b/Languages/ManageCalendar.english.php similarity index 100% rename from Themes/default/languages/ManageCalendar.english.php rename to Languages/ManageCalendar.english.php diff --git a/Themes/default/languages/ManageMail.english.php b/Languages/ManageMail.english.php similarity index 100% rename from Themes/default/languages/ManageMail.english.php rename to Languages/ManageMail.english.php diff --git a/Themes/default/languages/ManageMaintenance.english.php b/Languages/ManageMaintenance.english.php similarity index 100% rename from Themes/default/languages/ManageMaintenance.english.php rename to Languages/ManageMaintenance.english.php diff --git a/Themes/default/languages/ManageMembers.english.php b/Languages/ManageMembers.english.php similarity index 100% rename from Themes/default/languages/ManageMembers.english.php rename to Languages/ManageMembers.english.php diff --git a/Themes/default/languages/ManagePaid.english.php b/Languages/ManagePaid.english.php similarity index 100% rename from Themes/default/languages/ManagePaid.english.php rename to Languages/ManagePaid.english.php diff --git a/Themes/default/languages/ManagePermissions.english.php b/Languages/ManagePermissions.english.php similarity index 100% rename from Themes/default/languages/ManagePermissions.english.php rename to Languages/ManagePermissions.english.php diff --git a/Themes/default/languages/ManageScheduledTasks.english.php b/Languages/ManageScheduledTasks.english.php similarity index 100% rename from Themes/default/languages/ManageScheduledTasks.english.php rename to Languages/ManageScheduledTasks.english.php diff --git a/Themes/default/languages/ManageSettings.english.php b/Languages/ManageSettings.english.php similarity index 99% rename from Themes/default/languages/ManageSettings.english.php rename to Languages/ManageSettings.english.php index 3fb8ba4312..360dd477e4 100755 --- a/Themes/default/languages/ManageSettings.english.php +++ b/Languages/ManageSettings.english.php @@ -363,7 +363,7 @@ $txt['edit_language_entries_primary'] = 'Below are the primary language settings for this language pack.'; $txt['edit_language_entries'] = 'Edit Language Entries'; // argument(s): Config::$scripturl, $txt['themeadmin_edit_title'] -$txt['edit_language_entries_desc'] = 'You can customize the individual text entries for this language. Select a file to load its entries, and then edit them below.

When you edit (or remove) an entry, a commented out version of the original is preserved in the file. If you ever need to restore your edited strings to their original state, or if you need more advanced access to these language files, go to %2$s, browse to the file you are looking for, and then edit it directly using SMF\'s built-in text editor.'; +$txt['edit_language_entries_desc'] = 'You can customize the individual text entries for this language. Select a file to load its entries, and then edit them below.

When you edit (or remove) an entry, a commented out version of the original is preserved in the file. If you ever need to restore your edited strings to their original state, browse to the file you are looking for, and then edit it directly.'; $txt['edit_language_entries_file'] = 'Select entries to edit'; $txt['languages_dictionary'] = 'Dictionary'; $txt['languages_rtl'] = 'Enable "Right to Left" Mode'; diff --git a/Themes/default/languages/ManageSmileys.english.php b/Languages/ManageSmileys.english.php similarity index 100% rename from Themes/default/languages/ManageSmileys.english.php rename to Languages/ManageSmileys.english.php diff --git a/Themes/default/languages/Manual.english.php b/Languages/Manual.english.php similarity index 100% rename from Themes/default/languages/Manual.english.php rename to Languages/Manual.english.php diff --git a/Themes/default/languages/ModerationCenter.english.php b/Languages/ModerationCenter.english.php similarity index 100% rename from Themes/default/languages/ModerationCenter.english.php rename to Languages/ModerationCenter.english.php diff --git a/Themes/default/languages/Modifications.english.php b/Languages/Modifications.english.php similarity index 100% rename from Themes/default/languages/Modifications.english.php rename to Languages/Modifications.english.php diff --git a/Themes/default/languages/Modlog.english.php b/Languages/Modlog.english.php similarity index 100% rename from Themes/default/languages/Modlog.english.php rename to Languages/Modlog.english.php diff --git a/Themes/default/languages/Packages.english.php b/Languages/Packages.english.php similarity index 100% rename from Themes/default/languages/Packages.english.php rename to Languages/Packages.english.php diff --git a/Themes/default/languages/PersonalMessage.english.php b/Languages/PersonalMessage.english.php similarity index 100% rename from Themes/default/languages/PersonalMessage.english.php rename to Languages/PersonalMessage.english.php diff --git a/Themes/default/languages/Post.english.php b/Languages/Post.english.php similarity index 100% rename from Themes/default/languages/Post.english.php rename to Languages/Post.english.php diff --git a/Themes/default/languages/Profile.english.php b/Languages/Profile.english.php similarity index 100% rename from Themes/default/languages/Profile.english.php rename to Languages/Profile.english.php diff --git a/Themes/default/languages/Reports.english.php b/Languages/Reports.english.php similarity index 100% rename from Themes/default/languages/Reports.english.php rename to Languages/Reports.english.php diff --git a/Themes/default/languages/Search.english.php b/Languages/Search.english.php similarity index 100% rename from Themes/default/languages/Search.english.php rename to Languages/Search.english.php diff --git a/Themes/default/languages/Stats.english.php b/Languages/Stats.english.php similarity index 100% rename from Themes/default/languages/Stats.english.php rename to Languages/Stats.english.php diff --git a/Themes/default/languages/Themes.english.php b/Languages/Themes.english.php similarity index 100% rename from Themes/default/languages/Themes.english.php rename to Languages/Themes.english.php diff --git a/Themes/default/languages/Timezones.english.php b/Languages/Timezones.english.php similarity index 100% rename from Themes/default/languages/Timezones.english.php rename to Languages/Timezones.english.php diff --git a/Themes/default/languages/Who.english.php b/Languages/Who.english.php similarity index 100% rename from Themes/default/languages/Who.english.php rename to Languages/Who.english.php diff --git a/Themes/default/languages/index.english.php b/Languages/index.english.php similarity index 100% rename from Themes/default/languages/index.english.php rename to Languages/index.english.php diff --git a/Languages/index.php b/Languages/index.php new file mode 100644 index 0000000000..2cf5d33d8a --- /dev/null +++ b/Languages/index.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/Sources/Actions/Admin/Languages.php b/Sources/Actions/Admin/Languages.php index 755383e3e8..21b7236f2c 100644 --- a/Sources/Actions/Admin/Languages.php +++ b/Sources/Actions/Admin/Languages.php @@ -709,7 +709,9 @@ public function editEntries() Db::$db->free_result($request); // This will be where we look - $lang_dirs = []; + $lang_dirs = [ + Config::$languagesdir + ]; // There are different kinds of strings $string_types = ['txt', 'helptxt', 'editortxt', 'tztxt', 'txtBirthdayEmails']; @@ -752,7 +754,13 @@ public function editEntries() $current_file = $file_id ? $lang_dirs[$theme_id] . '/' . $file_id . '.' . $lang_id . '.php' : ''; // Now for every theme get all the files and stick them in context! - Utils::$context['possible_files'] = []; + Utils::$context['possible_files'] = [ + 0 => [ + 'id' => 0, + 'name' => Lang::$txt['languages_default'], + 'files' => [], + ] + ]; foreach ($lang_dirs as $theme => $theme_dir) { // Open it up. @@ -878,7 +886,7 @@ function ($val1, $val2) { SecurityToken::validate('admin-mlang'); // Read in the current file. - $current_data = implode('', file(Theme::$current->settings['default_theme_dir'] . '/languages/index.' . $lang_id . '.php')); + $current_data = implode('', file(Config::$languagesdir . '/index.' . $lang_id . '.php')); // Build the replacements. old => new $replace_array = []; @@ -889,7 +897,7 @@ function ($val1, $val2) { $current_data = preg_replace(array_keys($replace_array), array_values($replace_array), $current_data); - $fp = fopen(Theme::$current->settings['default_theme_dir'] . '/languages/index.' . $lang_id . '.php', 'w+'); + $fp = fopen(Config::$languagesdir . '/index.' . $lang_id . '.php', 'w+'); fwrite($fp, $current_data); fclose($fp); @@ -899,9 +907,9 @@ function ($val1, $val2) { // Quickly load index language entries. $old_txt = Lang::$txt; - require Theme::$current->settings['default_theme_dir'] . '/languages/index.' . $lang_id . '.php'; + require Config::$languagesdir . '/index.' . $lang_id . '.php'; - Utils::$context['lang_file_not_writable_message'] = is_writable(Theme::$current->settings['default_theme_dir'] . '/languages/index.' . $lang_id . '.php') ? '' : sprintf(Lang::$txt['lang_file_not_writable'], Theme::$current->settings['default_theme_dir'] . '/languages/index.' . $lang_id . '.php'); + Utils::$context['lang_file_not_writable_message'] = is_writable(Config::$languagesdir . '/index.' . $lang_id . '.php') ? '' : sprintf(Lang::$txt['lang_file_not_writable'], Config::$languagesdir . '/index.' . $lang_id . '.php'); // Setup the primary settings context. Utils::$context['primary_settings']['name'] = Utils::ucwords(strtr($lang_id, ['_' => ' ', '-utf8' => ''])); @@ -1571,7 +1579,7 @@ public static function list_getLanguages(): array // Get the language files and data... foreach (Utils::$context['languages'] as $lang) { // Load the file to get the character set. - require Theme::$current->settings['default_theme_dir'] . '/languages/index.' . $lang['filename'] . '.php'; + require Config::$languagesdir . '/index.' . $lang['filename'] . '.php'; $languages[$lang['filename']] = [ 'id' => $lang['filename'], diff --git a/Sources/Actions/Admin/Themes.php b/Sources/Actions/Admin/Themes.php index 0d17410dae..655c2c5b8e 100644 --- a/Sources/Actions/Admin/Themes.php +++ b/Sources/Actions/Admin/Themes.php @@ -1552,7 +1552,7 @@ protected function installCopy(): array '/css/rtl.css', '/scripts/theme.js', '/languages/index.php', - '/languages/Settings.english.php', + '/languages/ThemeStrings.english.php', ]; foreach ($to_copy as $file) { diff --git a/Sources/Config.php b/Sources/Config.php index 444a5d61ba..f741bb94ce 100644 --- a/Sources/Config.php +++ b/Sources/Config.php @@ -241,6 +241,12 @@ class Config * @var string */ public static $packagesdir; + /** + * Path to the Packages directory. + * + * @var string + */ + public static $languagesdir; /** * @var string * @@ -759,6 +765,18 @@ class Config 'raw_default' => true, 'type' => 'string', ], + 'languagesdir' => [ + 'text' => <<<'END' + /** + * @var string + * + * Path to the Languages directory. + */ + END, + 'default' => '__DIR__ . \'/Languages\'', + 'raw_default' => true, + 'type' => 'string', + ], 'tasksdir' => [ 'text' => <<<'END' /** @@ -785,8 +803,10 @@ class Config $packagesdir = $boarddir . '/Packages'; if (!is_dir(realpath($cachedir)) && is_dir($boarddir . '/cache')) $cachedir = $boarddir . '/cache'; + if (!is_dir(realpath($languagesdir)) && is_dir($boarddir . '/Languages')) + $languagesdir = $boarddir . '/Languages'; END, - 'search_pattern' => '~\n?(#[^\n]+)?(?:\n\h*if\s*\((?:\!file_exists\(\$(?' . '>boarddir|sourcedir|tasksdir|packagesdir|cachedir)\)|\!is_dir\(realpath\(\$(?' . '>boarddir|sourcedir|tasksdir|packagesdir|cachedir)\)\))[^;]+\n\h*\$(?' . '>boarddir|sourcedir|tasksdir|packagesdir|cachedir)[^\n]+;)+~sm', + 'search_pattern' => '~\n?(#[^\n]+)?(?:\n\h*if\s*\((?:\!file_exists\(\$(?'.'>boarddir|sourcedir|tasksdir|packagesdir|cachedir|languagesdir)\)|\!is_dir\(realpath\(\$(?'.'>boarddir|sourcedir|tasksdir|packagesdir|cachedir|languagesdir)\)\))[^;]+\n\h*\$(?'.'>boarddir|sourcedir|tasksdir|packagesdir|cachedir|languagesdir)[^\n]+;)+~sm', ], 'db_character_set' => [ 'text' => <<<'END' @@ -919,7 +939,7 @@ public static function set(array $settings): void '__DIR__' => var_export(dirname(SMF_SETTINGS_FILE), true), ]); - self::${$var} = eval($default); + self::${$var} = eval($default . ';'); } else { self::${$var} = $def['default']; } @@ -930,8 +950,10 @@ public static function set(array $settings): void } // Ensure there are no trailing slashes in these settings. - foreach (['boardurl', 'boarddir', 'sourcedir', 'packagesdir', 'tasksdir', 'cachedir'] as $var) { - self::${$var} = rtrim(self::${$var}, '\\/'); + foreach (['boardurl', 'boarddir', 'sourcedir', 'packagesdir', 'tasksdir', 'cachedir', 'languagesdir'] as $var) { + if (!is_null(self::${$var})) { + self::${$var} = rtrim(self::${$var}, "\\/"); + } } // Make sure the paths are correct... at least try to fix them. @@ -952,6 +974,11 @@ public static function set(array $settings): void self::$packagesdir = self::$boarddir . '/Packages'; } + if ((empty(self::$languagesdir) || !is_dir(realpath(self::$languagesdir))) && is_dir(self::$boarddir . '/Languages')) + { + self::$languagesdir = self::$boarddir . '/Languages'; + } + // Make absolutely sure the cache directory is defined and writable. if (empty(self::$cachedir) || !is_dir(self::$cachedir) || !is_writable(self::$cachedir)) { if (is_dir(self::$boarddir . '/cache') && is_writable(self::$boarddir . '/cache')) { diff --git a/Sources/Lang.php b/Sources/Lang.php index f33c90ff2d..cafc8a87e7 100644 --- a/Sources/Lang.php +++ b/Sources/Lang.php @@ -318,6 +318,8 @@ public static function addDirs(array|string $custom_dirs = []): void if (!empty($custom_dirs)) { self::$dirs = array_merge($custom_dirs, self::$dirs); } else { + self::$dirs[] = Config::$languagesdir; + // Make sure we have Theme::$current->settings - if not we're in trouble and need to find it! if (empty(Theme::$current->settings['default_theme_dir'])) { Theme::loadEssential(); @@ -354,6 +356,7 @@ public static function get(bool $use_cache = true): array // Default language directories to try. $language_directories = [ + Config::$languagesdir, Theme::$current->settings['default_theme_dir'] . '/languages', ]; diff --git a/Themes/default/languages/Settings.english.php b/Themes/default/languages/ThemeStrings.english.php similarity index 100% rename from Themes/default/languages/Settings.english.php rename to Themes/default/languages/ThemeStrings.english.php diff --git a/other/Settings.php b/other/Settings.php index a1cce7dfff..4b0c6eb7cc 100644 --- a/other/Settings.php +++ b/other/Settings.php @@ -215,6 +215,12 @@ * Path to the Packages directory. */ $packagesdir = dirname(__FILE__) . '/Packages'; +/** + * @var string + * + * Path to the language directory. + */ +$languagesdir = dirname(__FILE__) . '/Languages'; /** * @var string * @@ -233,6 +239,8 @@ $packagesdir = $boarddir . '/Packages'; if (!is_dir(realpath($cachedir)) && is_dir($boarddir . '/cache')) $cachedir = $boarddir . '/cache'; +if (!is_dir(realpath($languagesdir)) && is_dir($boarddir . '/Languages')) + $languagesdir = $boarddir . '/Languages'; ######### Legacy Settings ######### /** diff --git a/other/Settings_bak.php b/other/Settings_bak.php index a1cce7dfff..4b0c6eb7cc 100644 --- a/other/Settings_bak.php +++ b/other/Settings_bak.php @@ -215,6 +215,12 @@ * Path to the Packages directory. */ $packagesdir = dirname(__FILE__) . '/Packages'; +/** + * @var string + * + * Path to the language directory. + */ +$languagesdir = dirname(__FILE__) . '/Languages'; /** * @var string * @@ -233,6 +239,8 @@ $packagesdir = $boarddir . '/Packages'; if (!is_dir(realpath($cachedir)) && is_dir($boarddir . '/cache')) $cachedir = $boarddir . '/cache'; +if (!is_dir(realpath($languagesdir)) && is_dir($boarddir . '/Languages')) + $languagesdir = $boarddir . '/Languages'; ######### Legacy Settings ######### /** diff --git a/other/install.php b/other/install.php index 1d320e9343..9766544bee 100644 --- a/other/install.php +++ b/other/install.php @@ -328,9 +328,9 @@ function load_lang_file() $incontext['detected_languages'] = []; // Make sure the languages directory actually exists. - if (file_exists(Config::$boarddir . '/Themes/default/languages')) { + if (file_exists(Config::$languagesdir)) { // Find all the "Install" language files in the directory. - $dir = dir(Config::$boarddir . '/Themes/default/languages'); + $dir = dir(Config::$languagesdir); while ($entry = $dir->read()) { if (substr($entry, 0, 8) == 'Install.' && substr($entry, -4) == '.php') { @@ -370,7 +370,7 @@ function load_lang_file()

This installer was unable to find the installer\'s language file or files. They should be found under:

-
', dirname($_SERVER['PHP_SELF']) != '/' ? dirname($_SERVER['PHP_SELF']) : '', '/Themes/default/languages
+
', dirname($_SERVER['PHP_SELF']) != '/' ? dirname($_SERVER['PHP_SELF']) : '', '/Languages

In some cases, FTP clients do not properly upload files with this many folders. Please double check to make sure you have uploaded all the files in the distribution.

If that doesn\'t help, please make sure this install.php file is in the same place as the Themes folder.

@@ -389,7 +389,7 @@ function load_lang_file() } // Make sure it exists, if it doesn't reset it. - if (!isset($_SESSION['installer_temp_lang']) || preg_match('~[^\\w_\\-.]~', $_SESSION['installer_temp_lang']) === 1 || !file_exists(Config::$boarddir . '/Themes/default/languages/' . $_SESSION['installer_temp_lang'])) { + if (!isset($_SESSION['installer_temp_lang']) || preg_match('~[^\\w_\\-.]~', $_SESSION['installer_temp_lang']) === 1 || !file_exists(Config::$languagesdir . $_SESSION['installer_temp_lang'])) { // Use the first one... list($_SESSION['installer_temp_lang']) = array_keys($incontext['detected_languages']); @@ -403,7 +403,7 @@ function load_lang_file() Config::$language = preg_replace('~^Install\.|(-utf8)?\.php$~', '', $_SESSION['installer_temp_lang']); // Ensure SMF\Lang knows the path to the language directory. - Lang::addDirs(Config::$boarddir . '/Themes/default/languages'); + Lang::addDirs(Config::$languagesdir); // And now load the language file. Lang::load('Install'); @@ -571,7 +571,7 @@ function CheckFilesWritable() ]; foreach ($incontext['detected_languages'] as $lang => $temp) { - $extra_files[] = 'Themes/default/languages/' . $lang; + $extra_files[] = 'Languages/' . $lang; } // With mod_security installed, we could attempt to fix it with .htaccess. @@ -1065,6 +1065,7 @@ function ForumSettings() 'sourcedir' => $path . '/Sources', 'cachedir' => $path . '/cache', 'packagesdir' => $path . '/Packages', + 'languagesdir' => $path . '/Languages', 'tasksdir' => $path . '/Sources/Tasks', 'mbname' => strtr($_POST['mbname'], ['\"' => '"']), 'language' => substr($_SESSION['installer_temp_lang'], 8, -4), diff --git a/other/update_version_numbers.php b/other/update_version_numbers.php index ab97d278bb..9f321a6735 100644 --- a/other/update_version_numbers.php +++ b/other/update_version_numbers.php @@ -147,7 +147,7 @@ function ($filename) { } // Update SMF_LANG_VERSION -preg_match($lang_pattern, file_get_contents("{$basedir}/Themes/default/languages/index.english.php"), $matches); +preg_match($lang_pattern, file_get_contents("{$basedir}/Languages/index.english.php"), $matches); $lang_version = $matches[0]; diff --git a/other/upgrade.php b/other/upgrade.php index 7313a6b158..8f86b584cd 100644 --- a/other/upgrade.php +++ b/other/upgrade.php @@ -536,13 +536,7 @@ function load_lang_file() static $lang_dir = '', $detected_languages = [], $loaded_langfile = ''; - // Do we know where to look for the language files, or shall we just guess for now? - $temp = isset(Config::$modSettings['theme_dir']) ? Config::$modSettings['theme_dir'] . '/languages' : $upgrade_path . '/Themes/default/languages'; - - if ($lang_dir != $temp) { - $lang_dir = $temp; - $detected_languages = []; - } + $lang_dir = Config::$languagesdir; // Override the language file? if (isset($upcontext['language'])) { @@ -1008,12 +1002,12 @@ function WelcomeLogin() quickFileWritable($cachedir_temp . '/db_last_error.php'); - if (!file_exists(Config::$modSettings['theme_dir'] . '/languages/index.' . $upcontext['language'] . '.php')) { + if (!file_exists(Config::$languagesdir . '/index.' . $upcontext['language'] . '.php')) { return throw_error(sprintf(Lang::$txt['error_lang_index_missing'], $upcontext['language'], $upgradeurl)); } if (!isset($_GET['skiplang'])) { - $temp = substr(@implode('', @file(Config::$modSettings['theme_dir'] . '/languages/index.' . $upcontext['language'] . '.php')), 0, 4096); + $temp = substr(@implode('', @file(Config::$languagesdir . '/index.' . $upcontext['language'] . '.php')), 0, 4096); preg_match('~(?://|/\*)\s*Version:\s+(.+?);\s*index(?:[\s]{2}|\*/)~i', $temp, $match); if (empty($match[1]) || $match[1] != SMF_LANG_VERSION) { @@ -1347,14 +1341,14 @@ function checkLogin() $upcontext['upgrade_status']['pass'] = $upcontext['user']['pass']; // Set the language to that of the user? - if (isset($user_language) && $user_language != $upcontext['language'] && file_exists(Config::$modSettings['theme_dir'] . '/languages/index.' . basename($user_language, '.lng') . '.php')) { + if (isset($user_language) && $user_language != $upcontext['language'] && file_exists(Config::$languagesdir . '/index.' . basename($user_language, '.lng') . '.php')) { $user_language = basename($user_language, '.lng'); - $temp = substr(@implode('', @file(Config::$modSettings['theme_dir'] . '/languages/index.' . $user_language . '.php')), 0, 4096); + $temp = substr(@implode('', @file(Config::$languagesdir . '/index.' . $user_language . '.php')), 0, 4096); preg_match('~(?://|/\*)\s*Version:\s+(.+?);\s*index(?:[\s]{2}|\*/)~i', $temp, $match); if (empty($match[1]) || $match[1] != SMF_LANG_VERSION) { $upcontext['upgrade_options_warning'] = sprintf(Lang::$txt['warning_lang_old'], $user_language, $upcontext['language']); - } elseif (!file_exists(Config::$modSettings['theme_dir'] . '/languages/Install.' . $user_language . '.php')) { + } elseif (!file_exists(Config::$languagesdir . '/Install.' . $user_language . '.php')) { $upcontext['upgrade_options_warning'] = sprintf(Lang::$txt['warning_lang_missing'], $user_language, $upcontext['language']); } else { // Set this as the new language. @@ -1506,7 +1500,7 @@ function UpgradeOptions() } // If we're overriding the language follow it through. - if (isset($upcontext['lang']) && file_exists(Config::$modSettings['theme_dir'] . '/languages/index.' . $upcontext['lang'] . '.php')) { + if (isset($upcontext['lang']) && file_exists(Config::$languagesdir . '/index.' . $upcontext['lang'] . '.php')) { $changes['language'] = $upcontext['lang']; } @@ -1578,6 +1572,10 @@ function UpgradeOptions() $changes['packagesdir'] = fixRelativePath(Config::$boarddir) . '/Packages'; } + // Languages have moved! + if (empty(Config::$languagesdir)) + $changes['languagesdir'] = fixRelativePath(Config::$boarddir) . '/Languages'; + // Add support for $tasksdir var. if (empty(Config::$tasksdir)) { $changes['tasksdir'] = fixRelativePath(Config::$sourcedir) . '/Tasks'; @@ -2993,22 +2991,22 @@ function cmdStep0() print_error('Error: Unable to obtain write access to "db_last_error.php".'); } - if (!file_exists(Config::$modSettings['theme_dir'] . '/languages/index.' . $upcontext['language'] . '.php')) { + if (!file_exists(Config::$languagesdir . '/index.' . $upcontext['language'] . '.php')) { print_error('Error: Unable to find language files!', true); } else { - $temp = substr(@implode('', @file(Config::$modSettings['theme_dir'] . '/languages/index.' . $upcontext['language'] . '.php')), 0, 4096); + $temp = substr(@implode('', @file(Config::$languagesdir . '/index.' . $upcontext['language'] . '.php')), 0, 4096); preg_match('~(?://|/\*)\s*Version:\s+(.+?);\s*index(?:[\s]{2}|\*/)~i', $temp, $match); if (empty($match[1]) || $match[1] != SMF_LANG_VERSION) { print_error('Error: Language files out of date.', true); } - if (!file_exists(Config::$modSettings['theme_dir'] . '/languages/Install.' . $upcontext['language'] . '.php')) { + if (!file_exists(Config::$languagesdir . '/Install.' . $upcontext['language'] . '.php')) { print_error('Error: Install language is missing for selected language.', true); } // Otherwise include it! - require_once Config::$modSettings['theme_dir'] . '/languages/Install.' . $upcontext['language'] . '.php'; + require_once Config::$languagesdir . '/Install.' . $upcontext['language'] . '.php'; } // Do we need to add this setting? From 39d83f6baa149fd44bad1f55a0d4709ecdeb6bd2 Mon Sep 17 00:00:00 2001 From: jdarwood007 Date: Sun, 5 Nov 2023 10:28:09 -0800 Subject: [PATCH 02/35] Move agreement file --- agreement.txt => Languages/agreement.txt | 0 Sources/Actions/Admin/Languages.php | 4 ++-- Sources/Actions/Admin/Registration.php | 6 +++--- Sources/Actions/Agreement.php | 12 ++++++------ Sources/Actions/Register.php | 8 ++++---- Sources/Config.php | 2 +- Sources/PackageManager/SubsPackage.php | 3 ++- Sources/Theme.php | 2 +- other/Settings.php | 2 +- other/Settings_bak.php | 2 +- other/install.php | 2 +- other/upgrade.php | 4 ++-- 12 files changed, 24 insertions(+), 23 deletions(-) rename agreement.txt => Languages/agreement.txt (100%) diff --git a/agreement.txt b/Languages/agreement.txt similarity index 100% rename from agreement.txt rename to Languages/agreement.txt diff --git a/Sources/Actions/Admin/Languages.php b/Sources/Actions/Admin/Languages.php index 21b7236f2c..7647bf8934 100644 --- a/Sources/Actions/Admin/Languages.php +++ b/Sources/Actions/Admin/Languages.php @@ -829,8 +829,8 @@ function ($val1, $val2) { } // Third, the agreement file. - if (file_exists(Config::$boarddir . '/agreement.' . $lang_id . '.txt')) { - unlink(Config::$boarddir . '/agreement.' . $lang_id . '.txt'); + if (file_exists(Config::$languagesdir . '/agreement.' . $lang_id . '.txt')) { + unlink(Config::$languagesdir . '/agreement.' . $lang_id . '.txt'); } // Fourth, a related images folder, if it exists... diff --git a/Sources/Actions/Admin/Registration.php b/Sources/Actions/Admin/Registration.php index 3eb825b9c2..451f634722 100644 --- a/Sources/Actions/Admin/Registration.php +++ b/Sources/Actions/Admin/Registration.php @@ -224,7 +224,7 @@ public function agreement(): void // Try to figure out if we have more agreements. foreach (Utils::$context['languages'] as $lang) { - if (file_exists(Config::$boarddir . '/agreement.' . $lang['filename'] . '.txt')) { + if (file_exists(Config::$langaugesdir . '/agreement.' . $lang['filename'] . '.txt')) { Utils::$context['editable_agreements']['.' . $lang['filename']] = $lang['name']; // Are we editing this? @@ -236,7 +236,7 @@ public function agreement(): void $agreement_lang = empty(Utils::$context['current_agreement']) ? 'default' : substr(Utils::$context['current_agreement'], 1); - $agreement_file = Config::$boarddir . '/agreement' . Utils::$context['current_agreement'] . '.txt'; + $agreement_file = Config::$languagesdir . '/agreement' . Utils::$context['current_agreement'] . '.txt'; Utils::$context['agreement'] = file_exists($agreement_file) ? str_replace("\r", '', file_get_contents($agreement_file)) : ''; @@ -501,7 +501,7 @@ public static function call(): void public static function getConfigVars(): array { // Do we have at least default versions of the agreement and privacy policy? - $agreement = file_exists(Config::$boarddir . '/agreement.' . Lang::$default . '.txt') || file_exists(Config::$boarddir . '/agreement.txt'); + $agreement = file_exists(Config::$languagesdir . '/agreement.' . Lang::$default . '.txt') || file_exists(Config::$languagesdir . '/agreement.txt'); $policy = !empty(Config::$modSettings['policy_' . Lang::$default]); diff --git a/Sources/Actions/Agreement.php b/Sources/Actions/Agreement.php index b26453eb33..72352c21bb 100644 --- a/Sources/Actions/Agreement.php +++ b/Sources/Actions/Agreement.php @@ -118,7 +118,7 @@ public static function canRequireAgreement(): bool return false; } - $agreement_lang = file_exists(Config::$boarddir . '/agreement.' . User::$me->language . '.txt') ? User::$me->language : 'default'; + $agreement_lang = file_exists(Config::$languagesdir . '/agreement.' . User::$me->language . '.txt') ? User::$me->language : 'default'; if (empty(Config::$modSettings['agreement_updated_' . $agreement_lang])) { return false; @@ -177,14 +177,14 @@ protected function prepareAgreementContext(): void if (!Utils::$context['accept_doc'] || Utils::$context['can_accept_agreement']) { // Grab the agreement. // Have we got a localized one? - if (file_exists(Config::$boarddir . '/agreement.' . User::$me->language . '.txt')) { - Utils::$context['agreement_file'] = Config::$boarddir . '/agreement.' . User::$me->language . '.txt'; - } elseif (file_exists(Config::$boarddir . '/agreement.txt')) { - Utils::$context['agreement_file'] = Config::$boarddir . '/agreement.txt'; + if (file_exists(Config::$languagesdir . '/agreement.' . User::$me->language . '.txt')) { + Utils::$context['agreement_file'] = Config::$languagesdir . '/agreement.' . User::$me->language . '.txt'; + } elseif (file_exists(Config::$languagesdir . '/agreement.txt')) { + Utils::$context['agreement_file'] = Config::$languagesdir . '/agreement.txt'; } if (!empty(Utils::$context['agreement_file'])) { - $cache_id = strtr(Utils::$context['agreement_file'], [Config::$boarddir => '', '.txt' => '', '.' => '_']); + $cache_id = strtr(Utils::$context['agreement_file'], array(Config::$languagesdir => '', '.txt' => '', '.' => '_')); Utils::$context['agreement'] = BBCodeParser::load()->parse(file_get_contents(Utils::$context['agreement_file']), true, $cache_id); } elseif (Utils::$context['can_accept_agreement']) { ErrorHandler::fatalLang('error_no_agreement', false); diff --git a/Sources/Actions/Register.php b/Sources/Actions/Register.php index 65a4edfc52..d3be63c54d 100644 --- a/Sources/Actions/Register.php +++ b/Sources/Actions/Register.php @@ -190,10 +190,10 @@ public function show(): void // If you have to agree to the agreement, it needs to be fetched from the file. if (!empty(Config::$modSettings['requireAgreement'])) { // Have we got a localized one? - if (file_exists(Config::$boarddir . '/agreement.' . User::$me->language . '.txt')) { - Utils::$context['agreement'] = BBCodeParser::load()->parse(file_get_contents(Config::$boarddir . '/agreement.' . User::$me->language . '.txt'), true, 'agreement_' . User::$me->language); - } elseif (file_exists(Config::$boarddir . '/agreement.txt')) { - Utils::$context['agreement'] = BBCodeParser::load()->parse(file_get_contents(Config::$boarddir . '/agreement.txt'), true, 'agreement'); + if (file_exists(Config::$languagesdir . '/agreement.' . User::$me->language . '.txt')) { + Utils::$context['agreement'] = BBCodeParser::load()->parse(file_get_contents(Config::$languagesdir . '/agreement.' . User::$me->language . '.txt'), true, 'agreement_' . User::$me->language); + } elseif (file_exists(Config::$languagesdir . '/agreement.txt')) { + Utils::$context['agreement'] = BBCodeParser::load()->parse(file_get_contents(Config::$languagesdir . '/agreement.txt'), true, 'agreement'); } else { Utils::$context['agreement'] = ''; } diff --git a/Sources/Config.php b/Sources/Config.php index f741bb94ce..a0e0424050 100644 --- a/Sources/Config.php +++ b/Sources/Config.php @@ -793,7 +793,7 @@ class Config 'text' => <<<'END' # Make sure the paths are correct... at least try to fix them. - if (!is_dir(realpath($boarddir)) && file_exists(dirname(__FILE__) . '/agreement.txt')) + if (!is_dir(realpath($boarddir)) && file_exists(dirname(__FILE__) . '/SSI.php')) $boarddir = dirname(__FILE__); if (!is_dir(realpath($sourcedir)) && is_dir($boarddir . '/Sources')) $sourcedir = $boarddir . '/Sources'; diff --git a/Sources/PackageManager/SubsPackage.php b/Sources/PackageManager/SubsPackage.php index 7e9a9d896e..59763f34d8 100644 --- a/Sources/PackageManager/SubsPackage.php +++ b/Sources/PackageManager/SubsPackage.php @@ -2938,7 +2938,7 @@ public static function package_create_backup(string $id = 'backup'): bool { $files = []; - $base_files = ['index.php', 'SSI.php', 'agreement.txt', 'cron.php', 'proxy.php', 'ssi_examples.php', 'ssi_examples.shtml', 'subscriptions.php']; + $base_files = ['index.php', 'SSI.php', 'cron.php', 'proxy.php', 'ssi_examples.php', 'ssi_examples.shtml', 'subscriptions.php']; foreach ($base_files as $file) { if (file_exists(Config::$boarddir . '/' . $file)) { @@ -2948,6 +2948,7 @@ public static function package_create_backup(string $id = 'backup'): bool $dirs = [ Config::$sourcedir => empty($_REQUEST['use_full_paths']) ? 'Sources/' : strtr(Config::$sourcedir . '/', '\\', '/'), + Config::$languagesdir => empty($_REQUEST['use_full_paths']) ? 'Languages/' : strtr(Config::$languagesdir . '/', '\\', '/'), ]; $request = Db::$db->query( diff --git a/Sources/Theme.php b/Sources/Theme.php index 6fc3589662..c97f341d2c 100644 --- a/Sources/Theme.php +++ b/Sources/Theme.php @@ -1313,7 +1313,7 @@ public static function template_header(): void // If agreement is enabled, at least the english version shall exist if (!empty(Config::$modSettings['requireAgreement'])) { - $agreement = !file_exists(Config::$boarddir . '/agreement.txt'); + $agreement = !file_exists(Config::$languagesdir . '/agreement.txt'); } // If privacy policy is enabled, at least the default language version shall exist diff --git a/other/Settings.php b/other/Settings.php index 4b0c6eb7cc..32efe51d4f 100644 --- a/other/Settings.php +++ b/other/Settings.php @@ -229,7 +229,7 @@ $tasksdir = $sourcedir . '/Tasks'; # Make sure the paths are correct... at least try to fix them. -if (!is_dir(realpath($boarddir)) && file_exists(dirname(__FILE__) . '/agreement.txt')) +if (!is_dir(realpath($boarddir)) && file_exists(dirname(__FILE__) . '/SSI.php')) $boarddir = dirname(__FILE__); if (!is_dir(realpath($sourcedir)) && is_dir($boarddir . '/Sources')) $sourcedir = $boarddir . '/Sources'; diff --git a/other/Settings_bak.php b/other/Settings_bak.php index 4b0c6eb7cc..32efe51d4f 100644 --- a/other/Settings_bak.php +++ b/other/Settings_bak.php @@ -229,7 +229,7 @@ $tasksdir = $sourcedir . '/Tasks'; # Make sure the paths are correct... at least try to fix them. -if (!is_dir(realpath($boarddir)) && file_exists(dirname(__FILE__) . '/agreement.txt')) +if (!is_dir(realpath($boarddir)) && file_exists(dirname(__FILE__) . '/SSI.php')) $boarddir = dirname(__FILE__); if (!is_dir(realpath($sourcedir)) && is_dir($boarddir . '/Sources')) $sourcedir = $boarddir . '/Sources'; diff --git a/other/install.php b/other/install.php index 9766544bee..d741b688ef 100644 --- a/other/install.php +++ b/other/install.php @@ -564,7 +564,7 @@ function CheckFilesWritable() 'Packages', 'Smileys', 'Themes', - 'agreement.txt', + 'Languages/agreement.txt', 'Settings.php', 'Settings_bak.php', 'cache/db_last_error.php', diff --git a/other/upgrade.php b/other/upgrade.php index 8f86b584cd..8a87f49112 100644 --- a/other/upgrade.php +++ b/other/upgrade.php @@ -1020,7 +1020,7 @@ function WelcomeLogin() } // Check agreement.txt. (it may not exist, in which case $boarddir must be writable.) - if (isset(Config::$modSettings['agreement']) && (!is_writable(Config::$boarddir) || file_exists(Config::$boarddir . '/agreement.txt')) && !is_writable(Config::$boarddir . '/agreement.txt')) { + if (isset(Config::$modSettings['agreement']) && (!is_writable(Config::$languagesdir) || file_exists(Config::$languagesdir . '/agreement.txt')) && !is_writable(Config::$languagesdir . '/agreement.txt')) { return throw_error(Lang::$txt['error_agreement_not_writable']); } @@ -2955,7 +2955,7 @@ function cmdStep0() print_error('Error: Unable to obtain write access to "' . basename(SMF_SETTINGS_BACKUP_FILE) . '".'); } - if (isset(Config::$modSettings['agreement']) && (!is_writable(Config::$boarddir) || file_exists(Config::$boarddir . '/agreement.txt')) && !is_writable(Config::$boarddir . '/agreement.txt')) { + if (isset(Config::$modSettings['agreement']) && (!is_writable(Config::$languagesdir) || file_exists(Config::$languagesdir . '/agreement.txt')) && !is_writable(Config::$languagesdir . '/agreement.txt')) { print_error('Error: Unable to obtain write access to "agreement.txt".'); } elseif (isset(Config::$modSettings['agreement'])) { $fp = fopen(Config::$boarddir . '/agreement.txt', 'w'); From f79ac4cfb419af2d41ced64b4084c51113d69720 Mon Sep 17 00:00:00 2001 From: jdarwood007 Date: Sun, 5 Nov 2023 15:04:05 -0800 Subject: [PATCH 03/35] Upgrader should cleanup things, like old languages --- other/upgrade.php | 220 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 209 insertions(+), 11 deletions(-) diff --git a/other/upgrade.php b/other/upgrade.php index 8a87f49112..de87358fb2 100644 --- a/other/upgrade.php +++ b/other/upgrade.php @@ -116,14 +116,16 @@ // All the steps in detail. // Number,Name,Function,Progress Weight. +<<<<<<< HEAD $upcontext['steps'] = [ - 0 => [1, 'upgrade_step_login', 'WelcomeLogin', 2], - 1 => [2, 'upgrade_step_options', 'UpgradeOptions', 2], + 0 => [1, 'upgrade_step_login', 'WelcomeLogin', 1], + 1 => [2, 'upgrade_step_options', 'UpgradeOptions', 1], 2 => [3, 'upgrade_step_backup', 'BackupDatabase', 10], 3 => [4, 'upgrade_step_database', 'DatabaseChanges', 50], 4 => [5, 'upgrade_step_convertjson', 'serialize_to_json', 10], 5 => [6, 'upgrade_step_convertutf', 'ConvertUtf8', 20], - 6 => [7, 'upgrade_step_delete', 'DeleteUpgrade', 1], + 6 => [7, 'upgrade_step_cleanup', 'Cleanup', 2], + 7 => [8, 'upgrade_step_delete', 'DeleteUpgrade', 1], ]; // Just to remember which one has files in it. $upcontext['database_step'] = 3; @@ -1873,7 +1875,7 @@ function DatabaseChanges() return true; } - return false; + return $did_not_do === 0; } // Different versions of the files use different sql_modes @@ -3049,10 +3051,10 @@ function ConvertUtf8() // Done it already? if (!empty($_POST['utf8_done'])) { if ($command_line) { - return DeleteUpgrade(); - } - + return Cleanup(); + } else { return true; + } } // First make sure they aren't already on UTF-8 before we go anywhere... @@ -3066,13 +3068,12 @@ function ConvertUtf8() ); if ($command_line) { - return DeleteUpgrade(); - } - + return Cleanup(); + } else { return true; + } } - $upcontext['page_title'] = Lang::$txt['converting_utf8']; $upcontext['sub_template'] = isset($_GET['xml']) ? 'convert_xml' : 'convert_utf8'; @@ -3918,6 +3919,113 @@ function serialize_to_json() return false; } +function Cleanup() +{ + global $command_line, $upcontext, $support_js, $txt; + + $upcontext['sub_template'] = isset($_GET['xml']) ? 'cleanup_xml' : 'cleanup'; + $upcontext['page_title'] = Lang::$txt['upgrade_cleanup']; + + // Done it already - js wise? + if (!empty($_POST['cleanup_done'])) + return true; + + $cleanupSteps = array( + 0 => 'CleanupLanguages' + ); + + $upcontext['steps_count'] = count($cleanupSteps); + $upcontext['cur_substep_num'] = ((int) $_GET['substep']) ?? 0; + $upcontext['cur_substep'] = isset($cleanupSteps[$upcontext['cur_substep_num']]) ? $cleanupSteps[$upcontext['cur_substep_num']] : $cleanupSteps[0]; + $upcontext['cur_substep_name'] = isset($txt['cleanup_' . $upcontext['cur_substep']]) ? $txt['cleanup_' . $upcontext['cur_substep']] : $txt['upgrade_cleanup']; + $upcontext['step_progress'] = (int) (($upcontext['cur_substep_num'] / $upcontext['steps_count']) * 100); + + foreach ($cleanupSteps as $id => $substep) + if ($id < $_GET['substep']) + $upcontext['previous_substeps'][] = $substep; + + if ($command_line) + echo 'Cleaning up.'; + + if (!$support_js || isset($_GET['xml'])) + { + // Dubstep. + for ($substep = $upcontext['cur_substep_num']; $substep < $upcontext['steps_count']; $substep++) + { + $upcontext['step_progress'] = (int) (($substep / $upcontext['steps_count']) * 100); + $upcontext['cur_substep_name'] = isset($txt['cleanup_' . $cleanupSteps[$substep]]) ? $txt['cleanup_' . $cleanupSteps[$substep]] : $txt['upgrade_cleanup']; + $upcontext['cur_substep_num'] = $substep + 1; + + if ($command_line) + echo "\n" . ' +++ Clean up \"' . $upcontext['cur_substep_name'] . '"...'; + + // Timeouts + nextSubstep($substep); + + if ($command_line) + echo ' done.'; + + // Just to make sure it doesn't time out. + if (function_exists('apache_reset_timeout')) + @apache_reset_timeout(); + + // Do the cleanup stuff. + $cleanupSteps[$substep](); + + // If this is XML to keep it nice for the user do one cleanup at a time anyway! + if (isset($_GET['xml'])) + return upgradeExit(); + } + + if ($command_line) + { + echo "\n" . 'Successful.' . "\n"; + flush(); + } + + $upcontext['step_progress'] = 100; + $_GET['substep'] = 0; + return true; + } + + // If this fails we just move on to deleting the upgrade anyway... + $_GET['substep'] = 0; + return false; +} + +function CleanupLanguages() +{ + global $upcontext, $upgrade_path, $command_line; + + $old_languages_dir = isset(Config::$modSettings['theme_dir']) ? Config::$modSettings['theme_dir'] . '/languages' : $upgrade_path . '/Themes/default/languages';; + + // Can't do this if the old Themes/default/languages directory is not writable. + if(!quickFileWritable($old_languages_dir)) + return; + + $dir = dir($old_languages_dir); + while ($entry = $dir->read()) + { + if (in_array($entry, ['.', '..', 'index.php'])) + continue; + + // Skip ThemeStrings + if (substr($entry, 0, 13) == 'ThemeStrings.') + continue; + + // Rename Settings to ThemeStrings. + if (substr($entry, 0, 9) == 'Settings.' && substr($entry, -4) == '.php' && strpos($entry, '-utf8') === false) + { + quickFileWritable($old_languages_dir . '/' . $entry); + rename($old_languages_dir . '/' . $entry, $old_languages_dir . '/' . str_replace('Settings.', 'ThemeStrings.', $entry)); + } + else + deleteFile($old_languages_dir . '/' . $entry); + } + $dir->close(); +} + + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Templates are below this point ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ @@ -5208,6 +5316,96 @@ function template_serialize_json_xml() ', $upcontext['cur_table_name'], '
'; } +function template_cleanup() +{ + global $upcontext, $support_js, $is_debug; + + echo ' +

', Lang::$txt['upgrade_cleanup'], '

+
+ + ', Lang::$txt['upgrade_completed'], ' ', $upcontext['cur_substep_num'], ' ', Lang::$txt['upgrade_outof'], ' ', $upcontext['steps_count'], ' ', Lang::$txt['upgrade_steps'], ' +
+ +
'; + + // Dont any tables so far? + if (!empty($upcontext['previous_substeps'])) + foreach ($upcontext['previous_substeps'] as $substep) + echo ' +
', Lang::$txt['completed_cleanup_step'], ' "', $substep, '".'; + + echo ' +

+ ', Lang::$txt['upgrade_current_step'], ' "', $upcontext['cur_substep_name'], '" +

+

', Lang::$txt['upgrade_cleanup_completed'], '

'; + + // Continue please! + $upcontext['continue'] = $support_js ? 2 : 1; + + // If javascript allows we want to do this using XML. + if ($support_js) + { + echo ' + '; + } +} + +function template_cleanup_xml() +{ + global $upcontext; + + echo ' + ', $upcontext['cur_substep_name'], ''; +} + + function template_upgrade_complete() { global $upcontext, $upgradeurl, $settings, $is_debug; From 1f332e3acc8d857aabf80a70693013635200edad Mon Sep 17 00:00:00 2001 From: jdarwood007 Date: Sun, 5 Nov 2023 15:08:41 -0800 Subject: [PATCH 04/35] Cleanup old agreements --- other/upgrade.php | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/other/upgrade.php b/other/upgrade.php index de87358fb2..d869a08cdc 100644 --- a/other/upgrade.php +++ b/other/upgrade.php @@ -3931,7 +3931,8 @@ function Cleanup() return true; $cleanupSteps = array( - 0 => 'CleanupLanguages' + 0 => 'CleanupLanguages', + 0 => 'CleanupAgreements' ); $upcontext['steps_count'] = count($cleanupSteps); @@ -4025,6 +4026,28 @@ function CleanupLanguages() $dir->close(); } +function CleanupAgreements() +{ + global $upcontext, $upgrade_path, $command_line; + + // Can't do this if the old Themes/default/languages directory is not writable. + if(!quickFileWritable(Config::$boarddir)) + return; + + $dir = dir(Config::$boarddir); + while ($entry = $dir->read()) + { + if (in_array($entry, ['.', '..', 'index.php'])) + continue; + + // Skip anything not agreements. + if (substr($entry, 0, 11) == 'agreements.' || substr($entry, -4) !== '.txt') + continue; + + rename($Config::$boarddir . '/' . $entry, $Config::$languagesdir . '/' . $entry); + } + $dir->close(); +} /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Templates are below this point From 480d62f417b3571493c3cb67be34b60b8aaf2556 Mon Sep 17 00:00:00 2001 From: jdarwood007 Date: Sun, 5 Nov 2023 16:41:43 -0800 Subject: [PATCH 05/35] Update build tools --- composer.lock | 100 +++++++++++++++++++++++++------------------------- 1 file changed, 49 insertions(+), 51 deletions(-) diff --git a/composer.lock b/composer.lock index 5bf7ca61f3..0ac5407bff 100644 --- a/composer.lock +++ b/composer.lock @@ -227,21 +227,22 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.40.0", + "version": "v3.48.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "27d2b3265b5d550ec411b4319967ae7cfddfb2e0" + "reference": "a92472c6fb66349de25211f31c77eceae3df024e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/27d2b3265b5d550ec411b4319967ae7cfddfb2e0", - "reference": "27d2b3265b5d550ec411b4319967ae7cfddfb2e0", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/a92472c6fb66349de25211f31c77eceae3df024e", + "reference": "a92472c6fb66349de25211f31c77eceae3df024e", "shasum": "" }, "require": { "composer/semver": "^3.4", "composer/xdebug-handler": "^3.0.3", + "ext-filter": "*", "ext-json": "*", "ext-tokenizer": "*", "php": "^7.4 || ^8.0", @@ -266,10 +267,7 @@ "php-cs-fixer/accessible-object": "^1.1", "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4", - "phpspec/prophecy": "^1.17", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.6", - "symfony/phpunit-bridge": "^6.3.8 || ^7.0", + "phpunit/phpunit": "^9.6 || ^10.5.5", "symfony/yaml": "^5.4 || ^6.0 || ^7.0" }, "suggest": { @@ -308,7 +306,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.40.0" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.48.0" }, "funding": [ { @@ -316,7 +314,7 @@ "type": "github" } ], - "time": "2023-11-26T09:25:53+00:00" + "time": "2024-01-19T21:44:39+00:00" }, { "name": "overtrue/phplint", @@ -670,12 +668,12 @@ "source": { "type": "git", "url": "https://github.com/SimpleMachines/BuildTools.git", - "reference": "d183f2d31b0e3aacb8683b281c911212e269587a" + "reference": "09ee356ced8c086af7d264db918459f39513769e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/SimpleMachines/BuildTools/zipball/d183f2d31b0e3aacb8683b281c911212e269587a", - "reference": "d183f2d31b0e3aacb8683b281c911212e269587a", + "url": "https://api.github.com/repos/SimpleMachines/BuildTools/zipball/09ee356ced8c086af7d264db918459f39513769e", + "reference": "09ee356ced8c086af7d264db918459f39513769e", "shasum": "" }, "require": { @@ -688,20 +686,20 @@ "source": "https://github.com/SimpleMachines/BuildTools/tree/release-3.0", "issues": "https://github.com/SimpleMachines/BuildTools/issues" }, - "time": "2023-11-22T02:09:55+00:00" + "time": "2023-12-24T13:03:30+00:00" }, { "name": "symfony/cache", - "version": "v5.4.31", + "version": "v5.4.34", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "9c0a3a5d0718e51ff81e0605be38fe1acbee9eeb" + "reference": "b17f28169f7a2f2c0cddf2b044d729f5b75efe5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/9c0a3a5d0718e51ff81e0605be38fe1acbee9eeb", - "reference": "9c0a3a5d0718e51ff81e0605be38fe1acbee9eeb", + "url": "https://api.github.com/repos/symfony/cache/zipball/b17f28169f7a2f2c0cddf2b044d729f5b75efe5a", + "reference": "b17f28169f7a2f2c0cddf2b044d729f5b75efe5a", "shasum": "" }, "require": { @@ -769,7 +767,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v5.4.31" + "source": "https://github.com/symfony/cache/tree/v5.4.34" }, "funding": [ { @@ -785,7 +783,7 @@ "type": "tidelift" } ], - "time": "2023-11-06T17:37:55+00:00" + "time": "2023-12-18T14:56:06+00:00" }, { "name": "symfony/cache-contracts", @@ -868,16 +866,16 @@ }, { "name": "symfony/console", - "version": "v5.4.31", + "version": "v5.4.34", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "11ac5f154e0e5c4c77af83ad11ead9165280b92a" + "reference": "4b4d8cd118484aa604ec519062113dd87abde18c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/11ac5f154e0e5c4c77af83ad11ead9165280b92a", - "reference": "11ac5f154e0e5c4c77af83ad11ead9165280b92a", + "url": "https://api.github.com/repos/symfony/console/zipball/4b4d8cd118484aa604ec519062113dd87abde18c", + "reference": "4b4d8cd118484aa604ec519062113dd87abde18c", "shasum": "" }, "require": { @@ -947,7 +945,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.31" + "source": "https://github.com/symfony/console/tree/v5.4.34" }, "funding": [ { @@ -963,7 +961,7 @@ "type": "tidelift" } ], - "time": "2023-10-31T07:58:33+00:00" + "time": "2023-12-08T13:33:03+00:00" }, { "name": "symfony/deprecation-contracts", @@ -1034,16 +1032,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v5.4.26", + "version": "v5.4.34", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "5dcc00e03413f05c1e7900090927bb7247cb0aac" + "reference": "e3bca343efeb613f843c254e7718ef17c9bdf7a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/5dcc00e03413f05c1e7900090927bb7247cb0aac", - "reference": "5dcc00e03413f05c1e7900090927bb7247cb0aac", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/e3bca343efeb613f843c254e7718ef17c9bdf7a3", + "reference": "e3bca343efeb613f843c254e7718ef17c9bdf7a3", "shasum": "" }, "require": { @@ -1099,7 +1097,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.26" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.34" }, "funding": [ { @@ -1115,7 +1113,7 @@ "type": "tidelift" } ], - "time": "2023-07-06T06:34:20+00:00" + "time": "2023-12-27T21:12:56+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -1965,16 +1963,16 @@ }, { "name": "symfony/process", - "version": "v5.4.28", + "version": "v5.4.34", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b" + "reference": "8fa22178dfc368911dbd513b431cd9b06f9afe7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b", - "reference": "45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b", + "url": "https://api.github.com/repos/symfony/process/zipball/8fa22178dfc368911dbd513b431cd9b06f9afe7a", + "reference": "8fa22178dfc368911dbd513b431cd9b06f9afe7a", "shasum": "" }, "require": { @@ -2007,7 +2005,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.28" + "source": "https://github.com/symfony/process/tree/v5.4.34" }, "funding": [ { @@ -2023,7 +2021,7 @@ "type": "tidelift" } ], - "time": "2023-08-07T10:36:04+00:00" + "time": "2023-12-02T08:41:43+00:00" }, { "name": "symfony/service-contracts", @@ -2172,16 +2170,16 @@ }, { "name": "symfony/string", - "version": "v5.4.31", + "version": "v5.4.34", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "2765096c03f39ddf54f6af532166e42aaa05b24b" + "reference": "e3f98bfc7885c957488f443df82d97814a3ce061" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/2765096c03f39ddf54f6af532166e42aaa05b24b", - "reference": "2765096c03f39ddf54f6af532166e42aaa05b24b", + "url": "https://api.github.com/repos/symfony/string/zipball/e3f98bfc7885c957488f443df82d97814a3ce061", + "reference": "e3f98bfc7885c957488f443df82d97814a3ce061", "shasum": "" }, "require": { @@ -2238,7 +2236,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.31" + "source": "https://github.com/symfony/string/tree/v5.4.34" }, "funding": [ { @@ -2254,20 +2252,20 @@ "type": "tidelift" } ], - "time": "2023-11-09T08:19:44+00:00" + "time": "2023-12-09T13:20:28+00:00" }, { "name": "symfony/var-exporter", - "version": "v5.4.26", + "version": "v5.4.32", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "11401fe94f960249b3c63a488c63ba73091c1e4a" + "reference": "fdb022f0d3d41df240c18e2eb9a117c430f06add" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/11401fe94f960249b3c63a488c63ba73091c1e4a", - "reference": "11401fe94f960249b3c63a488c63ba73091c1e4a", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/fdb022f0d3d41df240c18e2eb9a117c430f06add", + "reference": "fdb022f0d3d41df240c18e2eb9a117c430f06add", "shasum": "" }, "require": { @@ -2311,7 +2309,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v5.4.26" + "source": "https://github.com/symfony/var-exporter/tree/v5.4.32" }, "funding": [ { @@ -2327,7 +2325,7 @@ "type": "tidelift" } ], - "time": "2023-07-20T07:21:16+00:00" + "time": "2023-11-16T19:33:05+00:00" }, { "name": "symfony/yaml", @@ -2417,5 +2415,5 @@ "platform-overrides": { "php": "8.0.0" }, - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.6.0" } From f684e5fba51fcc54c6377432c749504d5d5f2426 Mon Sep 17 00:00:00 2001 From: jdarwood007 Date: Fri, 10 Nov 2023 16:49:16 -0800 Subject: [PATCH 06/35] Change over to using locales instead of custom naming --- Languages/agreement.txt | 13 ------- .../Admin.en-us.php} | 0 .../Agreement.en-us.php} | 0 .../Alerts.en-us.php} | 0 .../Drafts.en-us.php} | 0 .../Editor.en-us.php} | 0 .../EmailTemplates.en-us.php} | 0 .../Errors.en-us.php} | 0 .../Help.en-us.php} | 0 .../Install.en-us.php} | 0 .../Login.en-us.php} | 0 .../ManageBoards.en-us.php} | 0 .../ManageCalendar.en-us.php} | 0 .../ManageMail.en-us.php} | 0 .../ManageMaintenance.en-us.php} | 0 .../ManageMembers.en-us.php} | 0 .../ManagePaid.en-us.php} | 0 .../ManagePermissions.en-us.php} | 0 .../ManageScheduledTasks.en-us.php} | 0 .../ManageSettings.en-us.php} | 0 .../ManageSmileys.en-us.php} | 0 .../Manual.en-us.php} | 0 .../ModerationCenter.en-us.php} | 0 .../Modifications.en-us.php} | 0 .../Modlog.en-us.php} | 0 .../Packages.en-us.php} | 0 .../PersonalMessage.en-us.php} | 0 .../Post.en-us.php} | 0 .../Profile.en-us.php} | 0 .../Reports.en-us.php} | 0 .../Search.en-us.php} | 0 .../Stats.en-us.php} | 0 .../Themes.en-us.php} | 0 .../Timezones.en-us.php} | 0 .../{Who.english.php => en-us/Who.en-us.php} | 0 .../index.en-us.php} | 2 +- Languages/en-us/index.php | 9 +++++ Sources/Actions/Admin/Languages.php | 34 +++++++++------- Sources/Actions/Admin/Themes.php | 2 +- Sources/Actions/Agreement.php | 10 ++--- Sources/Lang.php | 39 +++++++------------ Sources/Theme.php | 4 +- .../ThemeStrings.en-us.php} | 0 Themes/default/languages/en-us/index.php | 9 +++++ 44 files changed, 59 insertions(+), 63 deletions(-) delete mode 100644 Languages/agreement.txt rename Languages/{Admin.english.php => en-us/Admin.en-us.php} (100%) mode change 100755 => 100644 rename Languages/{Agreement.english.php => en-us/Agreement.en-us.php} (100%) rename Languages/{Alerts.english.php => en-us/Alerts.en-us.php} (100%) rename Languages/{Drafts.english.php => en-us/Drafts.en-us.php} (100%) rename Languages/{Editor.english.php => en-us/Editor.en-us.php} (100%) rename Languages/{EmailTemplates.english.php => en-us/EmailTemplates.en-us.php} (100%) rename Languages/{Errors.english.php => en-us/Errors.en-us.php} (100%) rename Languages/{Help.english.php => en-us/Help.en-us.php} (100%) rename Languages/{Install.english.php => en-us/Install.en-us.php} (100%) mode change 100755 => 100644 rename Languages/{Login.english.php => en-us/Login.en-us.php} (100%) rename Languages/{ManageBoards.english.php => en-us/ManageBoards.en-us.php} (100%) rename Languages/{ManageCalendar.english.php => en-us/ManageCalendar.en-us.php} (100%) rename Languages/{ManageMail.english.php => en-us/ManageMail.en-us.php} (100%) rename Languages/{ManageMaintenance.english.php => en-us/ManageMaintenance.en-us.php} (100%) rename Languages/{ManageMembers.english.php => en-us/ManageMembers.en-us.php} (100%) rename Languages/{ManagePaid.english.php => en-us/ManagePaid.en-us.php} (100%) rename Languages/{ManagePermissions.english.php => en-us/ManagePermissions.en-us.php} (100%) rename Languages/{ManageScheduledTasks.english.php => en-us/ManageScheduledTasks.en-us.php} (100%) rename Languages/{ManageSettings.english.php => en-us/ManageSettings.en-us.php} (100%) mode change 100755 => 100644 rename Languages/{ManageSmileys.english.php => en-us/ManageSmileys.en-us.php} (100%) rename Languages/{Manual.english.php => en-us/Manual.en-us.php} (100%) rename Languages/{ModerationCenter.english.php => en-us/ModerationCenter.en-us.php} (100%) rename Languages/{Modifications.english.php => en-us/Modifications.en-us.php} (100%) rename Languages/{Modlog.english.php => en-us/Modlog.en-us.php} (100%) rename Languages/{Packages.english.php => en-us/Packages.en-us.php} (100%) rename Languages/{PersonalMessage.english.php => en-us/PersonalMessage.en-us.php} (100%) rename Languages/{Post.english.php => en-us/Post.en-us.php} (100%) rename Languages/{Profile.english.php => en-us/Profile.en-us.php} (100%) rename Languages/{Reports.english.php => en-us/Reports.en-us.php} (100%) rename Languages/{Search.english.php => en-us/Search.en-us.php} (100%) rename Languages/{Stats.english.php => en-us/Stats.en-us.php} (100%) rename Languages/{Themes.english.php => en-us/Themes.en-us.php} (100%) rename Languages/{Timezones.english.php => en-us/Timezones.en-us.php} (100%) rename Languages/{Who.english.php => en-us/Who.en-us.php} (100%) rename Languages/{index.english.php => en-us/index.en-us.php} (99%) create mode 100644 Languages/en-us/index.php rename Themes/default/languages/{ThemeStrings.english.php => en-us/ThemeStrings.en-us.php} (100%) create mode 100644 Themes/default/languages/en-us/index.php diff --git a/Languages/agreement.txt b/Languages/agreement.txt deleted file mode 100644 index e500878631..0000000000 --- a/Languages/agreement.txt +++ /dev/null @@ -1,13 +0,0 @@ -You agree, through your use of this forum, that you will not post any material which is false, defamatory, inaccurate, abusive, vulgar, hateful, harassing, obscene, profane, sexually oriented, threatening, invasive of a person's privacy, adult material, or otherwise in violation of any International or United States Federal law. You also agree not to post any copyrighted material unless you own the copyright or you have written consent from the owner of the copyrighted material. Spam, flooding, advertisements, chain letters, pyramid schemes, and solicitations are also forbidden on this forum. - -Note that it is impossible for the staff or the owners of this forum to confirm the validity of posts. Please remember that we do not actively monitor the posted messages, and as such, are not responsible for the content contained within. We do not warrant the accuracy, completeness, or usefulness of any information presented. The posted messages express the views of the author, and not necessarily the views of this forum, its staff, its subsidiaries, or this forum's owner. Anyone who feels that a posted message is objectionable is encouraged to notify an administrator or moderator of this forum immediately. The staff and the owner of this forum reserve the right to remove objectionable content, within a reasonable time frame, if they determine that removal is necessary. This is a manual process, however, please realize that they may not be able to remove or edit particular messages immediately. This policy applies to member profile information as well. - -You remain solely responsible for the content of your posted messages. Furthermore, you agree to indemnify and hold harmless the owners of this forum, any related websites to this forum, its staff, and its subsidiaries. The owners of this forum also reserve the right to reveal your identity (or any other related information collected on this service) in the event of a formal complaint or legal action arising from any situation caused by your use of this forum. - -You have the ability, as you register, to choose your username. We advise that you keep the name appropriate. With this user account you are about to register, you agree to never give your password out to another person except an administrator, for your protection and for validity reasons. You also agree to NEVER use another person's account for any reason. We also HIGHLY recommend you use a complex and unique password for your account, to prevent account theft. - -After you register and login to this forum, you will be able to fill out a detailed profile. It is your responsibility to present clean and accurate information. Any information the forum owner or staff determines to be inaccurate or vulgar in nature will be removed, with or without prior notice. Appropriate sanctions may be applicable. - -Please note that with each post, your IP address is recorded, in the event that you need to be banned from this forum or your ISP contacted. This will only happen in the event of a major violation of this agreement. - -Also note that the software places a cookie, a text file containing bits of information (such as your username and password), in your browser's cache. This is ONLY used to keep you logged in/out. The software does not collect or send any other form of information to your computer. \ No newline at end of file diff --git a/Languages/Admin.english.php b/Languages/en-us/Admin.en-us.php old mode 100755 new mode 100644 similarity index 100% rename from Languages/Admin.english.php rename to Languages/en-us/Admin.en-us.php diff --git a/Languages/Agreement.english.php b/Languages/en-us/Agreement.en-us.php similarity index 100% rename from Languages/Agreement.english.php rename to Languages/en-us/Agreement.en-us.php diff --git a/Languages/Alerts.english.php b/Languages/en-us/Alerts.en-us.php similarity index 100% rename from Languages/Alerts.english.php rename to Languages/en-us/Alerts.en-us.php diff --git a/Languages/Drafts.english.php b/Languages/en-us/Drafts.en-us.php similarity index 100% rename from Languages/Drafts.english.php rename to Languages/en-us/Drafts.en-us.php diff --git a/Languages/Editor.english.php b/Languages/en-us/Editor.en-us.php similarity index 100% rename from Languages/Editor.english.php rename to Languages/en-us/Editor.en-us.php diff --git a/Languages/EmailTemplates.english.php b/Languages/en-us/EmailTemplates.en-us.php similarity index 100% rename from Languages/EmailTemplates.english.php rename to Languages/en-us/EmailTemplates.en-us.php diff --git a/Languages/Errors.english.php b/Languages/en-us/Errors.en-us.php similarity index 100% rename from Languages/Errors.english.php rename to Languages/en-us/Errors.en-us.php diff --git a/Languages/Help.english.php b/Languages/en-us/Help.en-us.php similarity index 100% rename from Languages/Help.english.php rename to Languages/en-us/Help.en-us.php diff --git a/Languages/Install.english.php b/Languages/en-us/Install.en-us.php old mode 100755 new mode 100644 similarity index 100% rename from Languages/Install.english.php rename to Languages/en-us/Install.en-us.php diff --git a/Languages/Login.english.php b/Languages/en-us/Login.en-us.php similarity index 100% rename from Languages/Login.english.php rename to Languages/en-us/Login.en-us.php diff --git a/Languages/ManageBoards.english.php b/Languages/en-us/ManageBoards.en-us.php similarity index 100% rename from Languages/ManageBoards.english.php rename to Languages/en-us/ManageBoards.en-us.php diff --git a/Languages/ManageCalendar.english.php b/Languages/en-us/ManageCalendar.en-us.php similarity index 100% rename from Languages/ManageCalendar.english.php rename to Languages/en-us/ManageCalendar.en-us.php diff --git a/Languages/ManageMail.english.php b/Languages/en-us/ManageMail.en-us.php similarity index 100% rename from Languages/ManageMail.english.php rename to Languages/en-us/ManageMail.en-us.php diff --git a/Languages/ManageMaintenance.english.php b/Languages/en-us/ManageMaintenance.en-us.php similarity index 100% rename from Languages/ManageMaintenance.english.php rename to Languages/en-us/ManageMaintenance.en-us.php diff --git a/Languages/ManageMembers.english.php b/Languages/en-us/ManageMembers.en-us.php similarity index 100% rename from Languages/ManageMembers.english.php rename to Languages/en-us/ManageMembers.en-us.php diff --git a/Languages/ManagePaid.english.php b/Languages/en-us/ManagePaid.en-us.php similarity index 100% rename from Languages/ManagePaid.english.php rename to Languages/en-us/ManagePaid.en-us.php diff --git a/Languages/ManagePermissions.english.php b/Languages/en-us/ManagePermissions.en-us.php similarity index 100% rename from Languages/ManagePermissions.english.php rename to Languages/en-us/ManagePermissions.en-us.php diff --git a/Languages/ManageScheduledTasks.english.php b/Languages/en-us/ManageScheduledTasks.en-us.php similarity index 100% rename from Languages/ManageScheduledTasks.english.php rename to Languages/en-us/ManageScheduledTasks.en-us.php diff --git a/Languages/ManageSettings.english.php b/Languages/en-us/ManageSettings.en-us.php old mode 100755 new mode 100644 similarity index 100% rename from Languages/ManageSettings.english.php rename to Languages/en-us/ManageSettings.en-us.php diff --git a/Languages/ManageSmileys.english.php b/Languages/en-us/ManageSmileys.en-us.php similarity index 100% rename from Languages/ManageSmileys.english.php rename to Languages/en-us/ManageSmileys.en-us.php diff --git a/Languages/Manual.english.php b/Languages/en-us/Manual.en-us.php similarity index 100% rename from Languages/Manual.english.php rename to Languages/en-us/Manual.en-us.php diff --git a/Languages/ModerationCenter.english.php b/Languages/en-us/ModerationCenter.en-us.php similarity index 100% rename from Languages/ModerationCenter.english.php rename to Languages/en-us/ModerationCenter.en-us.php diff --git a/Languages/Modifications.english.php b/Languages/en-us/Modifications.en-us.php similarity index 100% rename from Languages/Modifications.english.php rename to Languages/en-us/Modifications.en-us.php diff --git a/Languages/Modlog.english.php b/Languages/en-us/Modlog.en-us.php similarity index 100% rename from Languages/Modlog.english.php rename to Languages/en-us/Modlog.en-us.php diff --git a/Languages/Packages.english.php b/Languages/en-us/Packages.en-us.php similarity index 100% rename from Languages/Packages.english.php rename to Languages/en-us/Packages.en-us.php diff --git a/Languages/PersonalMessage.english.php b/Languages/en-us/PersonalMessage.en-us.php similarity index 100% rename from Languages/PersonalMessage.english.php rename to Languages/en-us/PersonalMessage.en-us.php diff --git a/Languages/Post.english.php b/Languages/en-us/Post.en-us.php similarity index 100% rename from Languages/Post.english.php rename to Languages/en-us/Post.en-us.php diff --git a/Languages/Profile.english.php b/Languages/en-us/Profile.en-us.php similarity index 100% rename from Languages/Profile.english.php rename to Languages/en-us/Profile.en-us.php diff --git a/Languages/Reports.english.php b/Languages/en-us/Reports.en-us.php similarity index 100% rename from Languages/Reports.english.php rename to Languages/en-us/Reports.en-us.php diff --git a/Languages/Search.english.php b/Languages/en-us/Search.en-us.php similarity index 100% rename from Languages/Search.english.php rename to Languages/en-us/Search.en-us.php diff --git a/Languages/Stats.english.php b/Languages/en-us/Stats.en-us.php similarity index 100% rename from Languages/Stats.english.php rename to Languages/en-us/Stats.en-us.php diff --git a/Languages/Themes.english.php b/Languages/en-us/Themes.en-us.php similarity index 100% rename from Languages/Themes.english.php rename to Languages/en-us/Themes.en-us.php diff --git a/Languages/Timezones.english.php b/Languages/en-us/Timezones.en-us.php similarity index 100% rename from Languages/Timezones.english.php rename to Languages/en-us/Timezones.en-us.php diff --git a/Languages/Who.english.php b/Languages/en-us/Who.en-us.php similarity index 100% rename from Languages/Who.english.php rename to Languages/en-us/Who.en-us.php diff --git a/Languages/index.english.php b/Languages/en-us/index.en-us.php similarity index 99% rename from Languages/index.english.php rename to Languages/en-us/index.en-us.php index ce2495c14d..fcc7a6fec7 100644 --- a/Languages/index.english.php +++ b/Languages/en-us/index.en-us.php @@ -2,7 +2,7 @@ // Version: 3.0 Alpha 1; index // Native name, please use full HTML entities to write your language's name. -$txt['native_name'] = 'English'; +$txt['native_name'] = 'English (US)'; // Locale (strftime, basename). For more information see: // - https://php.net/function.setlocale diff --git a/Languages/en-us/index.php b/Languages/en-us/index.php new file mode 100644 index 0000000000..2cf5d33d8a --- /dev/null +++ b/Languages/en-us/index.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/Sources/Actions/Admin/Languages.php b/Sources/Actions/Admin/Languages.php index 7647bf8934..3a9f8219e4 100644 --- a/Sources/Actions/Admin/Languages.php +++ b/Sources/Actions/Admin/Languages.php @@ -751,7 +751,7 @@ public function editEntries() } } - $current_file = $file_id ? $lang_dirs[$theme_id] . '/' . $file_id . '.' . $lang_id . '.php' : ''; + $current_file = $file_id ? $lang_dirs[$theme_id] . '/' . $lang_id . '/' . $file_id . '.' . $lang_id . '.php' : ''; // Now for every theme get all the files and stick them in context! Utils::$context['possible_files'] = [ @@ -763,8 +763,11 @@ public function editEntries() ]; foreach ($lang_dirs as $theme => $theme_dir) { + if (!is_dir($theme_dir . '/' . $lang_id)) + continue; + // Open it up. - $dir = dir($theme_dir); + $dir = dir($theme_dir . '/' . $lang_id); while ($entry = $dir->read()) { // We're only after the files for this language. @@ -817,20 +820,20 @@ function ($val1, $val2) { // Second, loop through the array to remove the files. foreach ($lang_dirs as $curPath) { foreach (Utils::$context['possible_files'][1]['files'] as $lang) { - if (file_exists($curPath . '/' . $lang['id'] . '.' . $lang_id . '.php')) { - unlink($curPath . '/' . $lang['id'] . '.' . $lang_id . '.php'); + if (file_exists($curPath . '/' . $lang_id . '/' . $lang['id'] . '.' . $lang_id . '.php')) { + unlink($curPath . '/' . $lang_id . '/' . $lang['id'] . '.' . $lang_id . '.php'); } } // Check for the email template. - if (file_exists($curPath . '/EmailTemplates.' . $lang_id . '.php')) { - unlink($curPath . '/EmailTemplates.' . $lang_id . '.php'); + if (file_exists($curPath . '/' . $lang_id . '/EmailTemplates.' . $lang_id . '.php')) { + unlink($curPath . '/' . $lang_id . '/EmailTemplates.' . $lang_id . '.php'); } } // Third, the agreement file. - if (file_exists(Config::$languagesdir . '/agreement.' . $lang_id . '.txt')) { - unlink(Config::$languagesdir . '/agreement.' . $lang_id . '.txt'); + if (file_exists(Config::$languagesdir . '/' . $lang_id . '/agreement.' . $lang_id . '.txt')) { + unlink(Config::$languagesdir . '/' . $lang_id . '/agreement.' . $lang_id . '.txt'); } // Fourth, a related images folder, if it exists... @@ -880,13 +883,14 @@ function ($val1, $val2) { ]; $madeSave = false; + $index_filename = Config::$languagesdir . '/' . $lang_id . '/' . 'index.' . $lang_id . '.php'; if (!empty($_POST['save_main']) && !$current_file) { User::$me->checkSession(); SecurityToken::validate('admin-mlang'); // Read in the current file. - $current_data = implode('', file(Config::$languagesdir . '/index.' . $lang_id . '.php')); + $current_data = implode('', file($index_filename)); // Build the replacements. old => new $replace_array = []; @@ -897,7 +901,7 @@ function ($val1, $val2) { $current_data = preg_replace(array_keys($replace_array), array_values($replace_array), $current_data); - $fp = fopen(Config::$languagesdir . '/index.' . $lang_id . '.php', 'w+'); + $fp = fopen($index_filename, 'w+'); fwrite($fp, $current_data); fclose($fp); @@ -907,9 +911,9 @@ function ($val1, $val2) { // Quickly load index language entries. $old_txt = Lang::$txt; - require Config::$languagesdir . '/index.' . $lang_id . '.php'; + require $index_filename; - Utils::$context['lang_file_not_writable_message'] = is_writable(Config::$languagesdir . '/index.' . $lang_id . '.php') ? '' : sprintf(Lang::$txt['lang_file_not_writable'], Config::$languagesdir . '/index.' . $lang_id . '.php'); + Utils::$context['lang_file_not_writable_message'] = is_writable($index_filename) ? '' : sprintf(Lang::$txt['lang_file_not_writable'], $index_filename); // Setup the primary settings context. Utils::$context['primary_settings']['name'] = Utils::ucwords(strtr($lang_id, ['_' => ' ', '-utf8' => ''])); @@ -1579,15 +1583,15 @@ public static function list_getLanguages(): array // Get the language files and data... foreach (Utils::$context['languages'] as $lang) { // Load the file to get the character set. - require Config::$languagesdir . '/index.' . $lang['filename'] . '.php'; + require $lang['location']; $languages[$lang['filename']] = [ 'id' => $lang['filename'], 'count' => 0, 'char_set' => Lang::$txt['lang_character_set'], - 'default' => Lang::$default == $lang['filename'] || (Lang::$default == '' && $lang['filename'] == 'english'), + 'default' => Lang::$default == $lang['filename'] || (Lang::$default == '' && $lang['filename'] == 'en-us'), 'locale' => Lang::$txt['lang_locale'], - 'name' => Utils::ucwords(strtr($lang['filename'], ['_' => ' ', '-utf8' => ''])), + 'name' => $lang['name'], ]; } diff --git a/Sources/Actions/Admin/Themes.php b/Sources/Actions/Admin/Themes.php index 655c2c5b8e..2e28b304c2 100644 --- a/Sources/Actions/Admin/Themes.php +++ b/Sources/Actions/Admin/Themes.php @@ -1552,7 +1552,7 @@ protected function installCopy(): array '/css/rtl.css', '/scripts/theme.js', '/languages/index.php', - '/languages/ThemeStrings.english.php', + '/languages/en-us/ThemeStrings.en-us.php', ]; foreach ($to_copy as $file) { diff --git a/Sources/Actions/Agreement.php b/Sources/Actions/Agreement.php index 72352c21bb..ab372e308f 100644 --- a/Sources/Actions/Agreement.php +++ b/Sources/Actions/Agreement.php @@ -118,7 +118,7 @@ public static function canRequireAgreement(): bool return false; } - $agreement_lang = file_exists(Config::$languagesdir . '/agreement.' . User::$me->language . '.txt') ? User::$me->language : 'default'; + $agreement_lang = file_exists(Config::$languagesdir . '/' . User::$me->language . '/agreement.' . User::$me->language . '.txt') ? User::$me->language : 'default'; if (empty(Config::$modSettings['agreement_updated_' . $agreement_lang])) { return false; @@ -177,10 +177,10 @@ protected function prepareAgreementContext(): void if (!Utils::$context['accept_doc'] || Utils::$context['can_accept_agreement']) { // Grab the agreement. // Have we got a localized one? - if (file_exists(Config::$languagesdir . '/agreement.' . User::$me->language . '.txt')) { - Utils::$context['agreement_file'] = Config::$languagesdir . '/agreement.' . User::$me->language . '.txt'; - } elseif (file_exists(Config::$languagesdir . '/agreement.txt')) { - Utils::$context['agreement_file'] = Config::$languagesdir . '/agreement.txt'; + if (file_exists(Config::$languagesdir . '/' . User::$me->language . '/agreement.' . User::$me->language . '.txt')) { + Utils::$context['agreement_file'] = Config::$languagesdir . '/' . User::$me->language . '/agreement.' . User::$me->language . '.txt'; + } elseif (file_exists(Config::$languagesdir . '/en-us/agreement.txt')) { + Utils::$context['agreement_file'] = Config::$languagesdir . '/en-us/agreement.txt'; } if (!empty(Utils::$context['agreement_file'])) { diff --git a/Sources/Lang.php b/Sources/Lang.php index cafc8a87e7..9e68b7a766 100644 --- a/Sources/Lang.php +++ b/Sources/Lang.php @@ -185,9 +185,9 @@ public static function load(string $template_name, string $lang = '', bool $fata } // Fall back to English if none of the preferred languages can be found. - if (empty(Config::$modSettings['disable_language_fallback']) && !in_array('english', [$lang, self::$default])) { + if (empty(Config::$modSettings['disable_language_fallback']) && !in_array('en-us', [$lang, self::$default])) { foreach (self::$dirs as $dir) { - $attempts[] = [$dir, $template, 'english']; + $attempts[] = [$dir, $template, 'en-us']; } } @@ -195,7 +195,7 @@ public static function load(string $template_name, string $lang = '', bool $fata $found = false; foreach ($attempts as $k => $file) { - if (file_exists($file[0] . '/' . $file[1] . '.' . $file[2] . '.php')) { + if (file_exists($file[0] . '/' . $file[2] . '/' . $file[1] . '.' . $file[2] . '.php')) { /** * @var string $forum_copyright * @var array $txt @@ -205,7 +205,8 @@ public static function load(string $template_name, string $lang = '', bool $fata * @var array $helptxt */ // Include it! - require $file[0] . '/' . $file[1] . '.' . $file[2] . '.php'; + // {DIR} / {locale} / {file} . {locale} .php + require $file[0] . '/' . $file[2] . '/' . $file[1] . '.' . $file[2] . '.php'; // Note that we found it. $found = true; @@ -225,7 +226,7 @@ public static function load(string $template_name, string $lang = '', bool $fata if (isset($forum_copyright)) { self::$localized_copyright[$file[2]] = $forum_copyright; - self::$forum_copyright = self::$localized_copyright[$lang] ?? (self::$localized_copyright[self::$default] ?? (self::$localized_copyright['english'] ?? '')); + self::$forum_copyright = self::$localized_copyright[$lang] ?? (self::$localized_copyright[self::$default] ?? (self::$localized_copyright['en-us'] ?? '')); unset($forum_copyright); } @@ -381,19 +382,13 @@ public static function get(bool $use_cache = true): array $dir = dir($language_dir); while ($entry = $dir->read()) { - // Look for the index language file... For good measure skip any "index.language-utf8.php" files - if (!preg_match('~^index\.((?:.(?!-utf8))+)\.php$~', $entry, $matches)) { + // Languages are in a sub directory. + if (!is_dir($language_dir . '/' . $entry) || !file_exists($language_dir . '/' . $entry . '/index.' . $entry . '.php')) { continue; } - $langName = Utils::ucwords(strtr($matches[1], ['_' => ' '])); - - if (($spos = strpos($langName, ' ')) !== false) { - $langName = substr($langName, 0, ++$spos) . '(' . substr($langName, $spos) . ')'; - } - // Get the line we need. - $fp = @fopen($language_dir . '/' . $entry, 'r'); + $fp = @fopen($language_dir . '/' . $entry . '/index.' . $entry . '.php', 'r'); // Yay! if ($fp) { @@ -407,7 +402,7 @@ public static function get(bool $use_cache = true): array // Set the language's name. if (!empty($matchNative) && !empty($matchNative[1])) { // Don't mislabel the language if the translator missed this one. - if ($langName !== 'English' && $matchNative[1] === 'English') { + if ($entry !== 'en-us' && $matchNative[1] === 'English') { break; } @@ -421,22 +416,16 @@ public static function get(bool $use_cache = true): array } // Build this language entry. - Utils::$context['languages'][$matches[1]] = [ - 'name' => $langName, + Utils::$context['languages'][$entry] = [ + 'name' => $langName ?? $entry, 'selected' => false, - 'filename' => $matches[1], - 'location' => $language_dir . '/index.' . $matches[1] . '.php', + 'filename' => $entry, + 'location' => $language_dir . '/' . $entry . '/index.' . $entry . '.php', ]; } $dir->close(); } - // Avoid confusion when we have more than one English variant installed. - // Honestly, our default English version should always have been called "English (US)" - if (substr_count(implode(' ', array_keys(Utils::$context['languages'])), 'english') > 1 && Utils::$context['languages']['english']['name'] === 'English') { - Utils::$context['languages']['english']['name'] = 'English (US)'; - } - // Let's cash in on this deal. if (!empty(CacheApi::$enable)) { CacheApi::put('known_languages', Utils::$context['languages'], !empty(CacheApi::$enable) && CacheApi::$enable < 1 ? 86400 : 3600); diff --git a/Sources/Theme.php b/Sources/Theme.php index c97f341d2c..126be70b84 100644 --- a/Sources/Theme.php +++ b/Sources/Theme.php @@ -2414,9 +2414,7 @@ protected function initialize(): void } // Any theme-related strings that need to be loaded? - if (!empty($this->settings['require_theme_strings'])) { - Lang::load('ThemeStrings', '', false); - } + Lang::load('ThemeStrings', '', false); // Make a special URL for the language. $this->settings['lang_images_url'] = $this->settings['images_url'] . '/' . (!empty(Lang::$txt['image_lang']) ? Lang::$txt['image_lang'] : User::$me->language); diff --git a/Themes/default/languages/ThemeStrings.english.php b/Themes/default/languages/en-us/ThemeStrings.en-us.php similarity index 100% rename from Themes/default/languages/ThemeStrings.english.php rename to Themes/default/languages/en-us/ThemeStrings.en-us.php diff --git a/Themes/default/languages/en-us/index.php b/Themes/default/languages/en-us/index.php new file mode 100644 index 0000000000..2cf5d33d8a --- /dev/null +++ b/Themes/default/languages/en-us/index.php @@ -0,0 +1,9 @@ + \ No newline at end of file From d28d1d3ea38b475283be9d4e9e301f7fab084b3a Mon Sep 17 00:00:00 2001 From: jdarwood007 Date: Fri, 10 Nov 2023 17:11:13 -0800 Subject: [PATCH 07/35] A few missed files --- .gitignore | 2 +- other/install.php | 40 ++++++++++++++++++++++++++---- other/upgrade.php | 62 ++++++++++++++++++++++++++++++++--------------- 3 files changed, 79 insertions(+), 25 deletions(-) diff --git a/.gitignore b/.gitignore index e22f3f073d..3d528ac5ee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # SMF Generated Files # ####################### -agreement.txt +/Languages/en-us/agreement.txt Settings.php Settings_bak.php Settings_org.php diff --git a/other/install.php b/other/install.php index d741b688ef..5da72ac7c2 100644 --- a/other/install.php +++ b/other/install.php @@ -333,9 +333,39 @@ function load_lang_file() $dir = dir(Config::$languagesdir); while ($entry = $dir->read()) { - if (substr($entry, 0, 8) == 'Install.' && substr($entry, -4) == '.php') { - $incontext['detected_languages'][$entry] = ucfirst(substr($entry, 8, strlen($entry) - 12)); + if (!is_dir(Config::$languagesdir . '/' . $entry) || !file_exists(Config::$languagesdir . '/' . $entry . '/' . 'Install.' . $entry . '.php') || !file_exists(Config::$languagesdir . '/' . $entry . '/' . 'index.' . $entry . '.php')) { + continue; } + + // Get the line we need. + $fp = @fopen($language_dir . '/' . $entry . '/' . 'index.' . $entry . '.php', 'r'); + + // Yay! + if ($fp) + { + while (($line = fgets($fp)) !== false) + { + if (strpos($line, '$txt[\'native_name\']') === false) + continue; + + preg_match('~\$txt\[\'native_name\'\]\s*=\s*\'([^\']+)\';~', $line, $matchNative); + + // Set the language's name. + if (!empty($matchNative) && !empty($matchNative[1])) + { + // Don't mislabel the language if the translator missed this one. + if ($entry !== 'en-us' && $matchNative[1] === 'English') + break; + + $langName = Utils::htmlspecialcharsDecode($matchNative[1]); + break; + } + } + + fclose($fp); + } + + $incontext['detected_languages'][$entry] = $langName ?? $entry; } $dir->close(); } @@ -389,13 +419,13 @@ function load_lang_file() } // Make sure it exists, if it doesn't reset it. - if (!isset($_SESSION['installer_temp_lang']) || preg_match('~[^\\w_\\-.]~', $_SESSION['installer_temp_lang']) === 1 || !file_exists(Config::$languagesdir . $_SESSION['installer_temp_lang'])) { + if (!isset($_SESSION['installer_temp_lang']) || preg_match('~[^\\w_\\-.]~', $_SESSION['installer_temp_lang']) === 1 || !file_exists(Config::$languagesdir . '/' . $_SESSION['installer_temp_lang'])) { // Use the first one... list($_SESSION['installer_temp_lang']) = array_keys($incontext['detected_languages']); // If we have english and some other language, use the other language. We Americans hate english :P. - if ($_SESSION['installer_temp_lang'] == 'Install.english.php' && count($incontext['detected_languages']) > 1) { - list(, $_SESSION['installer_temp_lang']) = array_keys($incontext['detected_languages']); + if ($_SESSION['installer_temp_lang'] == 'Install.en-us.php' && count($incontext['detected_languages']) > 1) { + list (, $_SESSION['installer_temp_lang']) = array_keys($incontext['detected_languages']); } } diff --git a/other/upgrade.php b/other/upgrade.php index d869a08cdc..f729fff7d9 100644 --- a/other/upgrade.php +++ b/other/upgrade.php @@ -116,7 +116,6 @@ // All the steps in detail. // Number,Name,Function,Progress Weight. -<<<<<<< HEAD $upcontext['steps'] = [ 0 => [1, 'upgrade_step_login', 'WelcomeLogin', 1], 1 => [2, 'upgrade_step_options', 'UpgradeOptions', 1], @@ -541,12 +540,14 @@ function load_lang_file() $lang_dir = Config::$languagesdir; // Override the language file? - if (isset($upcontext['language'])) { - $_SESSION['upgrader_langfile'] = 'Install.' . $upcontext['language'] . '.php'; - } elseif (isset($upcontext['lang'])) { - $_SESSION['upgrader_langfile'] = 'Install.' . $upcontext['lang'] . '.php'; - } elseif (isset(Config::$language)) { - $_SESSION['upgrader_langfile'] = 'Install.' . Config::$language . '.php'; + if (isset($upcontext['language']) && file_exists($lang_dir . '/' . $upcontext['language'] . '/Install.' . $upcontext['language'] . '.php')) { + $_SESSION['upgrader_langfile'] = $upcontext['language'] . '/Install.' . $upcontext['language'] . '.php'; + } elseif (isset($upcontext['lang']) && file_exists($lang_dir . '/' . $upcontext['lang'] . '/Install.' . $upcontext['lang'] . '.php')) { + $_SESSION['upgrader_langfile'] = $upcontext['lang'] . '/Install.' . $upcontext['lang'] . '.php'; + } elseif (isset(Config::$language) && file_exists($lang_dir . '/' . Config::$language . '/Install.' . Config::$language . '.php')) { + $_SESSION['upgrader_langfile'] = Config::$language . '/Install.' . Config::$language . '.php'; + } else { + $_SESSION['upgrader_langfile'] = Config::$language . '/Install.en-us.php'; } // Avoid pointless repetition @@ -562,19 +563,43 @@ function load_lang_file() $dir = dir($lang_dir); while ($entry = $dir->read()) { - // Skip any old '-utf8' language files that might be lying around - if (strpos($entry, '-utf8') !== false) { + if (!is_dir(Config::$languagesdir . '/' . $entry) || !file_exists(Config::$languagesdir . '/' . $entry . '/' . 'Install.' . $entry . '.php') || !file_exists(Config::$languagesdir . '/' . $entry . '/' . 'index.' . $entry . '.php')) { continue; } - if (substr($entry, 0, 8) == 'Install.' && substr($entry, -4) == '.php') { - $detected_languages[$entry] = ucfirst(substr($entry, 8, strlen($entry) - 12)); + // Get the line we need. + $fp = @fopen($language_dir . '/' . $entry . '/' . 'index.' . $entry . '.php', 'r'); + + // Yay! + if ($fp) { + while (($line = fgets($fp)) !== false) { + if (strpos($line, '$txt[\'native_name\']') === false) { + continue; + } + + preg_match('~\$txt\[\'native_name\'\]\s*=\s*\'([^\']+)\';~', $line, $matchNative); + + // Set the language's name. + if (!empty($matchNative) && !empty($matchNative[1])) { + // Don't mislabel the language if the translator missed this one. + if ($entry !== 'en-us' && $matchNative[1] === 'English') { + break; + } + + $langName = Utils::htmlspecialcharsDecode($matchNative[1]); + break; + } + } + + fclose($fp); } + + $detected_languages[$entry] = $langName ?? $entry; } $dir->close(); } - // Our guess was wrong, but that's fine. We'll try again after Config::$modSettings['theme_dir'] is defined. - elseif (!isset(Config::$modSettings['theme_dir'])) { + // Our guess was wrong, but that's fine. We'll try again after Config::$Languagesdir is defined. + elseif (!isset(Config::$Languagesdir)) { // Define a few essential strings for now. Lang::$txt['error_db_connect_settings'] = 'Cannot connect to the database server.

Please check that the database info variables are correct in Settings.php.'; Lang::$txt['error_sourcefile_missing'] = 'Unable to find the Sources/%1$s file. Please make sure it was uploaded properly, and then try again.'; @@ -661,8 +686,8 @@ function load_lang_file() list($_SESSION['upgrader_langfile']) = array_keys($detected_languages); // If we have English and some other language, use the other language. - if ($_SESSION['upgrader_langfile'] == 'Install.english.php' && count($detected_languages) > 1) { - list(, $_SESSION['upgrader_langfile']) = array_keys($detected_languages); + if ($_SESSION['upgrader_langfile'] == 'Install.en-us.php' && count($detected_languages) > 1) { + list (, $_SESSION['upgrader_langfile']) = array_keys($detected_languages); } } @@ -1004,12 +1029,11 @@ function WelcomeLogin() quickFileWritable($cachedir_temp . '/db_last_error.php'); - if (!file_exists(Config::$languagesdir . '/index.' . $upcontext['language'] . '.php')) { + if (!file_exists(Config::$languagesdir . '/' . $upcontext['language'] . '/index.' . $upcontext['language'] . '.php')) { return throw_error(sprintf(Lang::$txt['error_lang_index_missing'], $upcontext['language'], $upgradeurl)); - } + } elseif (!isset($_GET['skiplang'])) { + $temp = substr(@implode('', @file(Config::$languagesdir . '/' . $upcontext['language'] . '/index.' . $upcontext['language'] . '.php')), 0, 4096); - if (!isset($_GET['skiplang'])) { - $temp = substr(@implode('', @file(Config::$languagesdir . '/index.' . $upcontext['language'] . '.php')), 0, 4096); preg_match('~(?://|/\*)\s*Version:\s+(.+?);\s*index(?:[\s]{2}|\*/)~i', $temp, $match); if (empty($match[1]) || $match[1] != SMF_LANG_VERSION) { From 7fd1e7fc93e38ca114b13cc32a477fca3265049d Mon Sep 17 00:00:00 2001 From: jdarwood007 Date: Sat, 11 Nov 2023 08:23:03 -0800 Subject: [PATCH 08/35] Rename index.lang to General. Remove language suffix on file names --- .../en-us/{Admin.en-us.php => Admin.php} | 0 .../{Agreement.en-us.php => Agreement.php} | 0 .../en-us/{Alerts.en-us.php => Alerts.php} | 0 .../en-us/{Drafts.en-us.php => Drafts.php} | 0 .../en-us/{Editor.en-us.php => Editor.php} | 0 ...Templates.en-us.php => EmailTemplates.php} | 0 .../en-us/{Errors.en-us.php => Errors.php} | 0 .../en-us/{index.en-us.php => General.php} | 0 Languages/en-us/{Help.en-us.php => Help.php} | 0 .../en-us/{Install.en-us.php => Install.php} | 0 .../en-us/{Login.en-us.php => Login.php} | 0 ...anageBoards.en-us.php => ManageBoards.php} | 0 ...eCalendar.en-us.php => ManageCalendar.php} | 0 .../{ManageMail.en-us.php => ManageMail.php} | 0 ...enance.en-us.php => ManageMaintenance.php} | 0 ...ageMembers.en-us.php => ManageMembers.php} | 0 .../{ManagePaid.en-us.php => ManagePaid.php} | 0 ...ssions.en-us.php => ManagePermissions.php} | 0 ...sks.en-us.php => ManageScheduledTasks.php} | 0 ...eSettings.en-us.php => ManageSettings.php} | 0 ...ageSmileys.en-us.php => ManageSmileys.php} | 0 .../en-us/{Manual.en-us.php => Manual.php} | 0 ...nCenter.en-us.php => ModerationCenter.php} | 0 ...ifications.en-us.php => Modifications.php} | 0 .../en-us/{Modlog.en-us.php => Modlog.php} | 0 .../{Packages.en-us.php => Packages.php} | 0 ...lMessage.en-us.php => PersonalMessage.php} | 0 Languages/en-us/{Post.en-us.php => Post.php} | 0 .../en-us/{Profile.en-us.php => Profile.php} | 0 .../en-us/{Reports.en-us.php => Reports.php} | 0 .../en-us/{Search.en-us.php => Search.php} | 0 .../en-us/{Stats.en-us.php => Stats.php} | 0 .../en-us/{Themes.en-us.php => Themes.php} | 0 .../{Timezones.en-us.php => Timezones.php} | 0 Languages/en-us/{Who.en-us.php => Who.php} | 0 Sources/Actions/Admin/Attachments.php | 4 +- Sources/Actions/Admin/Languages.php | 14 +- Sources/Actions/Admin/Themes.php | 83 +- Sources/Actions/Agreement.php | 6 +- Sources/Actions/Display.php | 4 +- Sources/Actions/JavaScriptModify.php | 4 +- Sources/Actions/Post.php | 4 +- Sources/Actions/TopicMerge.php | 8 +- Sources/Actions/TopicMove.php | 4 +- Sources/Actions/TopicMove2.php | 6 +- Sources/Attachment.php | 2 +- Sources/Lang.php | 17 +- Sources/Mail.php | 2 +- Sources/PersonalMessage/PM.php | 10 +- Sources/TaskRunner.php | 2 +- Sources/Tasks/CreatePost_Notify.php | 2 +- Sources/Tasks/ExportProfileData.php | 2 +- Sources/Tasks/SendDigests.php | 2 +- Sources/Theme.php | 12 +- Sources/User.php | 2 +- ...hemeStrings.en-us.php => ThemeStrings.php} | 0 composer.lock | 2286 ++--------------- other/upgrade.php | 2 +- 58 files changed, 326 insertions(+), 2152 deletions(-) rename Languages/en-us/{Admin.en-us.php => Admin.php} (100%) rename Languages/en-us/{Agreement.en-us.php => Agreement.php} (100%) rename Languages/en-us/{Alerts.en-us.php => Alerts.php} (100%) rename Languages/en-us/{Drafts.en-us.php => Drafts.php} (100%) rename Languages/en-us/{Editor.en-us.php => Editor.php} (100%) rename Languages/en-us/{EmailTemplates.en-us.php => EmailTemplates.php} (100%) rename Languages/en-us/{Errors.en-us.php => Errors.php} (100%) rename Languages/en-us/{index.en-us.php => General.php} (100%) rename Languages/en-us/{Help.en-us.php => Help.php} (100%) rename Languages/en-us/{Install.en-us.php => Install.php} (100%) rename Languages/en-us/{Login.en-us.php => Login.php} (100%) rename Languages/en-us/{ManageBoards.en-us.php => ManageBoards.php} (100%) rename Languages/en-us/{ManageCalendar.en-us.php => ManageCalendar.php} (100%) rename Languages/en-us/{ManageMail.en-us.php => ManageMail.php} (100%) rename Languages/en-us/{ManageMaintenance.en-us.php => ManageMaintenance.php} (100%) rename Languages/en-us/{ManageMembers.en-us.php => ManageMembers.php} (100%) rename Languages/en-us/{ManagePaid.en-us.php => ManagePaid.php} (100%) rename Languages/en-us/{ManagePermissions.en-us.php => ManagePermissions.php} (100%) rename Languages/en-us/{ManageScheduledTasks.en-us.php => ManageScheduledTasks.php} (100%) rename Languages/en-us/{ManageSettings.en-us.php => ManageSettings.php} (100%) rename Languages/en-us/{ManageSmileys.en-us.php => ManageSmileys.php} (100%) rename Languages/en-us/{Manual.en-us.php => Manual.php} (100%) rename Languages/en-us/{ModerationCenter.en-us.php => ModerationCenter.php} (100%) rename Languages/en-us/{Modifications.en-us.php => Modifications.php} (100%) rename Languages/en-us/{Modlog.en-us.php => Modlog.php} (100%) rename Languages/en-us/{Packages.en-us.php => Packages.php} (100%) rename Languages/en-us/{PersonalMessage.en-us.php => PersonalMessage.php} (100%) rename Languages/en-us/{Post.en-us.php => Post.php} (100%) rename Languages/en-us/{Profile.en-us.php => Profile.php} (100%) rename Languages/en-us/{Reports.en-us.php => Reports.php} (100%) rename Languages/en-us/{Search.en-us.php => Search.php} (100%) rename Languages/en-us/{Stats.en-us.php => Stats.php} (100%) rename Languages/en-us/{Themes.en-us.php => Themes.php} (100%) rename Languages/en-us/{Timezones.en-us.php => Timezones.php} (100%) rename Languages/en-us/{Who.en-us.php => Who.php} (100%) rename Themes/default/languages/en-us/{ThemeStrings.en-us.php => ThemeStrings.php} (100%) diff --git a/Languages/en-us/Admin.en-us.php b/Languages/en-us/Admin.php similarity index 100% rename from Languages/en-us/Admin.en-us.php rename to Languages/en-us/Admin.php diff --git a/Languages/en-us/Agreement.en-us.php b/Languages/en-us/Agreement.php similarity index 100% rename from Languages/en-us/Agreement.en-us.php rename to Languages/en-us/Agreement.php diff --git a/Languages/en-us/Alerts.en-us.php b/Languages/en-us/Alerts.php similarity index 100% rename from Languages/en-us/Alerts.en-us.php rename to Languages/en-us/Alerts.php diff --git a/Languages/en-us/Drafts.en-us.php b/Languages/en-us/Drafts.php similarity index 100% rename from Languages/en-us/Drafts.en-us.php rename to Languages/en-us/Drafts.php diff --git a/Languages/en-us/Editor.en-us.php b/Languages/en-us/Editor.php similarity index 100% rename from Languages/en-us/Editor.en-us.php rename to Languages/en-us/Editor.php diff --git a/Languages/en-us/EmailTemplates.en-us.php b/Languages/en-us/EmailTemplates.php similarity index 100% rename from Languages/en-us/EmailTemplates.en-us.php rename to Languages/en-us/EmailTemplates.php diff --git a/Languages/en-us/Errors.en-us.php b/Languages/en-us/Errors.php similarity index 100% rename from Languages/en-us/Errors.en-us.php rename to Languages/en-us/Errors.php diff --git a/Languages/en-us/index.en-us.php b/Languages/en-us/General.php similarity index 100% rename from Languages/en-us/index.en-us.php rename to Languages/en-us/General.php diff --git a/Languages/en-us/Help.en-us.php b/Languages/en-us/Help.php similarity index 100% rename from Languages/en-us/Help.en-us.php rename to Languages/en-us/Help.php diff --git a/Languages/en-us/Install.en-us.php b/Languages/en-us/Install.php similarity index 100% rename from Languages/en-us/Install.en-us.php rename to Languages/en-us/Install.php diff --git a/Languages/en-us/Login.en-us.php b/Languages/en-us/Login.php similarity index 100% rename from Languages/en-us/Login.en-us.php rename to Languages/en-us/Login.php diff --git a/Languages/en-us/ManageBoards.en-us.php b/Languages/en-us/ManageBoards.php similarity index 100% rename from Languages/en-us/ManageBoards.en-us.php rename to Languages/en-us/ManageBoards.php diff --git a/Languages/en-us/ManageCalendar.en-us.php b/Languages/en-us/ManageCalendar.php similarity index 100% rename from Languages/en-us/ManageCalendar.en-us.php rename to Languages/en-us/ManageCalendar.php diff --git a/Languages/en-us/ManageMail.en-us.php b/Languages/en-us/ManageMail.php similarity index 100% rename from Languages/en-us/ManageMail.en-us.php rename to Languages/en-us/ManageMail.php diff --git a/Languages/en-us/ManageMaintenance.en-us.php b/Languages/en-us/ManageMaintenance.php similarity index 100% rename from Languages/en-us/ManageMaintenance.en-us.php rename to Languages/en-us/ManageMaintenance.php diff --git a/Languages/en-us/ManageMembers.en-us.php b/Languages/en-us/ManageMembers.php similarity index 100% rename from Languages/en-us/ManageMembers.en-us.php rename to Languages/en-us/ManageMembers.php diff --git a/Languages/en-us/ManagePaid.en-us.php b/Languages/en-us/ManagePaid.php similarity index 100% rename from Languages/en-us/ManagePaid.en-us.php rename to Languages/en-us/ManagePaid.php diff --git a/Languages/en-us/ManagePermissions.en-us.php b/Languages/en-us/ManagePermissions.php similarity index 100% rename from Languages/en-us/ManagePermissions.en-us.php rename to Languages/en-us/ManagePermissions.php diff --git a/Languages/en-us/ManageScheduledTasks.en-us.php b/Languages/en-us/ManageScheduledTasks.php similarity index 100% rename from Languages/en-us/ManageScheduledTasks.en-us.php rename to Languages/en-us/ManageScheduledTasks.php diff --git a/Languages/en-us/ManageSettings.en-us.php b/Languages/en-us/ManageSettings.php similarity index 100% rename from Languages/en-us/ManageSettings.en-us.php rename to Languages/en-us/ManageSettings.php diff --git a/Languages/en-us/ManageSmileys.en-us.php b/Languages/en-us/ManageSmileys.php similarity index 100% rename from Languages/en-us/ManageSmileys.en-us.php rename to Languages/en-us/ManageSmileys.php diff --git a/Languages/en-us/Manual.en-us.php b/Languages/en-us/Manual.php similarity index 100% rename from Languages/en-us/Manual.en-us.php rename to Languages/en-us/Manual.php diff --git a/Languages/en-us/ModerationCenter.en-us.php b/Languages/en-us/ModerationCenter.php similarity index 100% rename from Languages/en-us/ModerationCenter.en-us.php rename to Languages/en-us/ModerationCenter.php diff --git a/Languages/en-us/Modifications.en-us.php b/Languages/en-us/Modifications.php similarity index 100% rename from Languages/en-us/Modifications.en-us.php rename to Languages/en-us/Modifications.php diff --git a/Languages/en-us/Modlog.en-us.php b/Languages/en-us/Modlog.php similarity index 100% rename from Languages/en-us/Modlog.en-us.php rename to Languages/en-us/Modlog.php diff --git a/Languages/en-us/Packages.en-us.php b/Languages/en-us/Packages.php similarity index 100% rename from Languages/en-us/Packages.en-us.php rename to Languages/en-us/Packages.php diff --git a/Languages/en-us/PersonalMessage.en-us.php b/Languages/en-us/PersonalMessage.php similarity index 100% rename from Languages/en-us/PersonalMessage.en-us.php rename to Languages/en-us/PersonalMessage.php diff --git a/Languages/en-us/Post.en-us.php b/Languages/en-us/Post.php similarity index 100% rename from Languages/en-us/Post.en-us.php rename to Languages/en-us/Post.php diff --git a/Languages/en-us/Profile.en-us.php b/Languages/en-us/Profile.php similarity index 100% rename from Languages/en-us/Profile.en-us.php rename to Languages/en-us/Profile.php diff --git a/Languages/en-us/Reports.en-us.php b/Languages/en-us/Reports.php similarity index 100% rename from Languages/en-us/Reports.en-us.php rename to Languages/en-us/Reports.php diff --git a/Languages/en-us/Search.en-us.php b/Languages/en-us/Search.php similarity index 100% rename from Languages/en-us/Search.en-us.php rename to Languages/en-us/Search.php diff --git a/Languages/en-us/Stats.en-us.php b/Languages/en-us/Stats.php similarity index 100% rename from Languages/en-us/Stats.en-us.php rename to Languages/en-us/Stats.php diff --git a/Languages/en-us/Themes.en-us.php b/Languages/en-us/Themes.php similarity index 100% rename from Languages/en-us/Themes.en-us.php rename to Languages/en-us/Themes.php diff --git a/Languages/en-us/Timezones.en-us.php b/Languages/en-us/Timezones.php similarity index 100% rename from Languages/en-us/Timezones.en-us.php rename to Languages/en-us/Timezones.php diff --git a/Languages/en-us/Who.en-us.php b/Languages/en-us/Who.php similarity index 100% rename from Languages/en-us/Who.en-us.php rename to Languages/en-us/Who.php diff --git a/Sources/Actions/Admin/Attachments.php b/Sources/Actions/Admin/Attachments.php index b70c7ff51a..da75c9c25b 100644 --- a/Sources/Actions/Admin/Attachments.php +++ b/Sources/Actions/Admin/Attachments.php @@ -596,7 +596,7 @@ public function remove(): void // And change the message to reflect this. if (!empty($messages)) { - Lang::load('index', Lang::$default, true); + Lang::load('General', Lang::$default, true); Db::$db->query( '', @@ -609,7 +609,7 @@ public function remove(): void ], ); - Lang::load('index', User::$me->language, true); + Lang::load('General', User::$me->language, true); } } } diff --git a/Sources/Actions/Admin/Languages.php b/Sources/Actions/Admin/Languages.php index 3a9f8219e4..7a6813777f 100644 --- a/Sources/Actions/Admin/Languages.php +++ b/Sources/Actions/Admin/Languages.php @@ -751,7 +751,7 @@ public function editEntries() } } - $current_file = $file_id ? $lang_dirs[$theme_id] . '/' . $lang_id . '/' . $file_id . '.' . $lang_id . '.php' : ''; + $current_file = $file_id ? $lang_dirs[$theme_id] . '/' . $lang_id . '/' . $file_id . '.php' : ''; // Now for every theme get all the files and stick them in context! Utils::$context['possible_files'] = [ @@ -820,20 +820,20 @@ function ($val1, $val2) { // Second, loop through the array to remove the files. foreach ($lang_dirs as $curPath) { foreach (Utils::$context['possible_files'][1]['files'] as $lang) { - if (file_exists($curPath . '/' . $lang_id . '/' . $lang['id'] . '.' . $lang_id . '.php')) { - unlink($curPath . '/' . $lang_id . '/' . $lang['id'] . '.' . $lang_id . '.php'); + if (file_exists($curPath . '/' . $lang_id . '/' . $lang['id'] . '.php')) { + unlink($curPath . '/' . $lang_id . '/' . $lang['id'] . '.php'); } } // Check for the email template. - if (file_exists($curPath . '/' . $lang_id . '/EmailTemplates.' . $lang_id . '.php')) { - unlink($curPath . '/' . $lang_id . '/EmailTemplates.' . $lang_id . '.php'); + if (file_exists($curPath . '/' . $lang_id . '/EmailTemplates.php')) { + unlink($curPath . '/' . $lang_id . '/EmailTemplates.php'); } } // Third, the agreement file. - if (file_exists(Config::$languagesdir . '/' . $lang_id . '/agreement.' . $lang_id . '.txt')) { - unlink(Config::$languagesdir . '/' . $lang_id . '/agreement.' . $lang_id . '.txt'); + if (file_exists(Config::$languagesdir . '/' . $lang_id . '/agreement.txt')) { + unlink(Config::$languagesdir . '/' . $lang_id . '/agreement.txt'); } // Fourth, a related images folder, if it exists... diff --git a/Sources/Actions/Admin/Themes.php b/Sources/Actions/Admin/Themes.php index 2e28b304c2..ae95e540b1 100644 --- a/Sources/Actions/Admin/Themes.php +++ b/Sources/Actions/Admin/Themes.php @@ -710,9 +710,6 @@ public function setSettings(): void Theme::loadSubTemplate('init', 'ignore'); // Also load the actual themes language file - in case of special settings. - Lang::load('Settings', '', true, true); - - // And the custom language strings... Lang::load('ThemeStrings', '', false, true); // Let the theme take care of the settings. @@ -1252,26 +1249,29 @@ public function copy(): void $templates = []; $lang_files = []; - $dir = dir(Theme::$current->settings['default_theme_dir']); - - while ($entry = $dir->read()) { - if (substr($entry, -13) == '.template.php') { - $templates[] = substr($entry, 0, -13); + foreach (new \DirectoryIterator(Theme::$current->settings['default_theme_dir']) as $fileInfo) { + if (substr($fileInfo->getFilename(), -13) == '.template.php') { + $templates[] = substr($fileInfo->getFilename(), 0, -13); } } - $dir->close(); + if (is_dir(Theme::$current->settings['default_theme_dir'] . '/languages')) { + foreach (new \DirectoryIterator(Theme::$current->settings['default_theme_dir'] . '/languages') as $langDir) + { + if (!is_dir($langDir->getPathname()) || $langDir->getFilename()[0] == '.') + continue; - $dir = dir(Theme::$current->settings['default_theme_dir'] . '/languages'); + $lang_files[$langDir->getFilename()] = []; - while ($entry = $dir->read()) { - if (preg_match('~^([^\.]+\.[^\.]+)\.php$~', $entry, $matches)) { - $lang_files[] = $matches[1]; + foreach (new \DirectoryIterator($langDir->getPathname()) as $fileInfo) + { + if ($fileInfo->getExtension() == 'php') { + $lang_files[$langDir->getFilename()][] = $fileInfo->getFilename(); + } + } } } - $dir->close(); - natcasesort($templates); natcasesort($lang_files); @@ -1288,39 +1288,44 @@ public function copy(): void Utils::$context['available_language_files'] = []; - foreach ($lang_files as $file) { - Utils::$context['available_language_files'][$file] = [ - 'filename' => $file . '.php', - 'value' => $file, - 'already_exists' => false, - 'can_copy' => file_exists($theme['theme_dir'] . '/languages') ? is_writable($theme['theme_dir'] . '/languages') : is_writable($theme['theme_dir']), - ]; + foreach ($lang_files as $dir => $lang_dir) { + foreach ($lang_dir as $file) { + Utils::$context['available_language_files'][$dir . '/' . $file] = [ + 'filename' => $dir . '/' . $file . '.php', + 'value' => $dir . '|' . $file, + 'already_exists' => false, + 'can_copy' => file_exists($theme['theme_dir'] . '/languages') ? is_writable($theme['theme_dir'] . '/languages') : is_writable($theme['theme_dir']), + ]; + } } - $dir = dir($theme['theme_dir']); + foreach (new \DirectoryIterator($theme['theme_dir']) as $fileInfo) { + $theme_basename = substr($fileInfo->getFilename(), 0, -13); - while ($entry = $dir->read()) { - if (substr($entry, -13) == '.template.php' && isset(Utils::$context['available_templates'][substr($entry, 0, -13)])) { - Utils::$context['available_templates'][substr($entry, 0, -13)]['already_exists'] = true; - - Utils::$context['available_templates'][substr($entry, 0, -13)]['can_copy'] = is_writable($theme['theme_dir'] . '/' . $entry); + if (substr($fileInfo->getFilename(), -13) == '.template.php' && isset(Utils::$context['available_templates'][$theme_basename])) { + Utils::$context['available_templates'][$theme_basename]['already_exists'] = true; + Utils::$context['available_templates'][$theme_basename]['can_copy'] = is_writable($theme['theme_dir'] . '/' . $theme_basename); } } - $dir->close(); - - if (file_exists($theme['theme_dir'] . '/languages')) { - $dir = dir($theme['theme_dir'] . '/languages'); + if (is_dir($theme['theme_dir'] . '/languages')) + { + foreach (new \DirectoryIterator($theme['theme_dir'] . '/languages') as $langDir) + { + if (!is_dir($langDir->getPathname()) || $langDir->getFilename()[0] == '.') { + continue; + } - while ($entry = $dir->read()) { - if (preg_match('~^([^\.]+\.[^\.]+)\.php$~', $entry, $matches) && isset(Utils::$context['available_language_files'][$matches[1]])) { - Utils::$context['available_language_files'][$matches[1]]['already_exists'] = true; + $lang_files[$langDir->getFilename()] = []; - Utils::$context['available_language_files'][$matches[1]]['can_copy'] = is_writable($theme['theme_dir'] . '/languages/' . $entry); + foreach (new \DirectoryIterator($langDir->getPathname()) as $fileInfo) { + if ($fileInfo->getExtension() == 'php' && isset(Utils::$context['available_language_files'][$langDir->getFilename() . '/' . $fileInfo->getFilename()])) + { + Utils::$context['available_language_files'][$langDir->getFilename() . '/' . $fileInfo->getFilename()]['already_exists'] = true; + Utils::$context['available_language_files'][$langDir->getFilename() . '/' . $fileInfo->getFilename()]['can_copy'] = is_writable($theme['theme_dir'] . '/languages/' . $entry); + } } } - - $dir->close(); } Utils::$context['sub_template'] = 'copy_template'; @@ -1552,7 +1557,7 @@ protected function installCopy(): array '/css/rtl.css', '/scripts/theme.js', '/languages/index.php', - '/languages/en-us/ThemeStrings.en-us.php', + '/languages/en-us/ThemeStrings.php', ]; foreach ($to_copy as $file) { diff --git a/Sources/Actions/Agreement.php b/Sources/Actions/Agreement.php index ab372e308f..f0a23295a1 100644 --- a/Sources/Actions/Agreement.php +++ b/Sources/Actions/Agreement.php @@ -118,7 +118,7 @@ public static function canRequireAgreement(): bool return false; } - $agreement_lang = file_exists(Config::$languagesdir . '/' . User::$me->language . '/agreement.' . User::$me->language . '.txt') ? User::$me->language : 'default'; + $agreement_lang = file_exists(Config::$languagesdir . '/' . User::$me->language . '/agreement.txt') ? User::$me->language : 'default'; if (empty(Config::$modSettings['agreement_updated_' . $agreement_lang])) { return false; @@ -177,8 +177,8 @@ protected function prepareAgreementContext(): void if (!Utils::$context['accept_doc'] || Utils::$context['can_accept_agreement']) { // Grab the agreement. // Have we got a localized one? - if (file_exists(Config::$languagesdir . '/' . User::$me->language . '/agreement.' . User::$me->language . '.txt')) { - Utils::$context['agreement_file'] = Config::$languagesdir . '/' . User::$me->language . '/agreement.' . User::$me->language . '.txt'; + if (file_exists(Config::$languagesdir . '/' . User::$me->language . '/agreement.txt')) { + Utils::$context['agreement_file'] = Config::$languagesdir . '/' . User::$me->language . '/agreement.txt'; } elseif (file_exists(Config::$languagesdir . '/en-us/agreement.txt')) { Utils::$context['agreement_file'] = Config::$languagesdir . '/en-us/agreement.txt'; } diff --git a/Sources/Actions/Display.php b/Sources/Actions/Display.php index aacef63c06..0d1404f247 100644 --- a/Sources/Actions/Display.php +++ b/Sources/Actions/Display.php @@ -997,9 +997,9 @@ protected function setupTemplate(): void if (Lang::$default === User::$me->language) { Utils::$context['response_prefix'] = Lang::$txt['response_prefix']; } else { - Lang::load('index', Lang::$default, false); + Lang::load('General', Lang::$default, false); Utils::$context['response_prefix'] = Lang::$txt['response_prefix']; - Lang::load('index'); + Lang::load('General'); } CacheApi::put('response_prefix', Utils::$context['response_prefix'], 600); } diff --git a/Sources/Actions/JavaScriptModify.php b/Sources/Actions/JavaScriptModify.php index a9246dca17..2ed0dfb35a 100644 --- a/Sources/Actions/JavaScriptModify.php +++ b/Sources/Actions/JavaScriptModify.php @@ -231,9 +231,9 @@ public function execute(): void if (Lang::$default === User::$me->language) { Utils::$context['response_prefix'] = Lang::$txt['response_prefix']; } else { - Lang::load('index', Lang::$default, false); + Lang::load('General', Lang::$default, false); Utils::$context['response_prefix'] = Lang::$txt['response_prefix']; - Lang::load('index'); + Lang::load('General'); } CacheApi::put('response_prefix', Utils::$context['response_prefix'], 600); } diff --git a/Sources/Actions/Post.php b/Sources/Actions/Post.php index 173ff6b991..850800a105 100644 --- a/Sources/Actions/Post.php +++ b/Sources/Actions/Post.php @@ -855,9 +855,9 @@ protected function setResponsePrefix(): void if (Lang::$default === User::$me->language) { Utils::$context['response_prefix'] = Lang::$txt['response_prefix']; } else { - Lang::load('index', Lang::$default, false); + Lang::load('General', Lang::$default, false); Utils::$context['response_prefix'] = Lang::$txt['response_prefix']; - Lang::load('index'); + Lang::load('General'); } CacheApi::put('response_prefix', Utils::$context['response_prefix'], 600); } diff --git a/Sources/Actions/TopicMerge.php b/Sources/Actions/TopicMerge.php index 3dd79f245a..f39c61aa11 100644 --- a/Sources/Actions/TopicMerge.php +++ b/Sources/Actions/TopicMerge.php @@ -606,7 +606,7 @@ public function merge(): void // Should be in the boardwide language. if (User::$me->language != Lang::$default) { - Lang::load('index', Lang::$default); + Lang::load('General', Lang::$default); // Make sure we catch both languages in the reason. $reason_replacements += [ @@ -656,7 +656,7 @@ public function merge(): void // Restore language strings to normal. if (User::$me->language != Lang::$default) { - Lang::load('index'); + Lang::load('General'); } } @@ -665,9 +665,9 @@ public function merge(): void if (Lang::$default === User::$me->language) { Utils::$context['response_prefix'] = Lang::$txt['response_prefix']; } else { - Lang::load('index', Lang::$default, false); + Lang::load('General', Lang::$default, false); Utils::$context['response_prefix'] = Lang::$txt['response_prefix']; - Lang::load('index'); + Lang::load('General'); } CacheApi::put('response_prefix', Utils::$context['response_prefix'], 600); diff --git a/Sources/Actions/TopicMove.php b/Sources/Actions/TopicMove.php index f1c5125c3e..a9dded63a1 100644 --- a/Sources/Actions/TopicMove.php +++ b/Sources/Actions/TopicMove.php @@ -136,9 +136,9 @@ public function execute(): void Utils::$context['back_to_topic'] = isset($_REQUEST['goback']); if (User::$me->language != Lang::$default) { - Lang::load('index', Lang::$default); + Lang::load('General', Lang::$default); $temp = Lang::$txt['movetopic_default']; - Lang::load('index'); + Lang::load('General'); Lang::$txt['movetopic_default'] = $temp; } diff --git a/Sources/Actions/TopicMove2.php b/Sources/Actions/TopicMove2.php index 4176cf6b85..8e5f634cd6 100644 --- a/Sources/Actions/TopicMove2.php +++ b/Sources/Actions/TopicMove2.php @@ -152,9 +152,9 @@ public function execute(): void if (Lang::$default === User::$me->language) { Utils::$context['response_prefix'] = Lang::$txt['response_prefix']; } else { - Lang::load('index', Lang::$default, false); + Lang::load('General', Lang::$default, false); Utils::$context['response_prefix'] = Lang::$txt['response_prefix']; - Lang::load('index'); + Lang::load('General'); } CacheApi::put('response_prefix', Utils::$context['response_prefix'], 600); } @@ -198,7 +198,7 @@ public function execute(): void // Should be in the boardwide language. if (User::$me->language != Lang::$default) { - Lang::load('index', Lang::$default); + Lang::load('General', Lang::$default); // Make sure we catch both languages in the reason. $reason_replacements += [ diff --git a/Sources/Attachment.php b/Sources/Attachment.php index e277c9b044..de2e5f1cb4 100644 --- a/Sources/Attachment.php +++ b/Sources/Attachment.php @@ -444,7 +444,7 @@ public function __set(string $prop, mixed $value): void } if (($this->prop_aliases[$prop] ?? $prop) === 'size') { - Lang::load('index'); + Lang::load('General'); $this->formatted_size = ($this->size < 1024000) ? round($this->size / 1024, 2) . ' ' . Lang::$txt['kilobyte'] : round($this->size / 1024 / 1024, 2) . ' ' . Lang::$txt['megabyte']; } diff --git a/Sources/Lang.php b/Sources/Lang.php index 9e68b7a766..2595ef6118 100644 --- a/Sources/Lang.php +++ b/Sources/Lang.php @@ -177,6 +177,11 @@ public static function load(string $template_name, string $lang = '', bool $fata // For each file open it up and write it out! foreach (explode('+', $template_name) as $template) { + // Did we call the old index language file? Redirect. + if ($template === 'index') { + $template = 'General'; + } + $attempts = []; foreach (self::$dirs as $dir) { @@ -195,7 +200,7 @@ public static function load(string $template_name, string $lang = '', bool $fata $found = false; foreach ($attempts as $k => $file) { - if (file_exists($file[0] . '/' . $file[2] . '/' . $file[1] . '.' . $file[2] . '.php')) { + if (file_exists($file[0] . '/' . $file[2] . '/' . $file[1] . '.php')) { /** * @var string $forum_copyright * @var array $txt @@ -205,8 +210,8 @@ public static function load(string $template_name, string $lang = '', bool $fata * @var array $helptxt */ // Include it! - // {DIR} / {locale} / {file} . {locale} .php - require $file[0] . '/' . $file[2] . '/' . $file[1] . '.' . $file[2] . '.php'; + // {DIR} / {locale} / {file} .php + require $file[0] . '/' . $file[2] . '/' . $file[1] . '.php'; // Note that we found it. $found = true; @@ -383,12 +388,12 @@ public static function get(bool $use_cache = true): array while ($entry = $dir->read()) { // Languages are in a sub directory. - if (!is_dir($language_dir . '/' . $entry) || !file_exists($language_dir . '/' . $entry . '/index.' . $entry . '.php')) { + if (!is_dir($language_dir . '/' . $entry) || !file_exists($language_dir . '/' . $entry . '/General.php')) { continue; } // Get the line we need. - $fp = @fopen($language_dir . '/' . $entry . '/index.' . $entry . '.php', 'r'); + $fp = @fopen($language_dir . '/' . $entry . '/General.php', 'r'); // Yay! if ($fp) { @@ -420,7 +425,7 @@ public static function get(bool $use_cache = true): array 'name' => $langName ?? $entry, 'selected' => false, 'filename' => $entry, - 'location' => $language_dir . '/' . $entry . '/index.' . $entry . '.php', + 'location' => $language_dir . '/' . $entry . '/General.php', ]; } $dir->close(); diff --git a/Sources/Mail.php b/Sources/Mail.php index 0c349c1c2c..11ca872684 100644 --- a/Sources/Mail.php +++ b/Sources/Mail.php @@ -372,7 +372,7 @@ public static function reduceQueue(bool|int $number = false, bool $override_limi if (empty(Lang::$txt)) { Theme::loadEssential(); Lang::load('Errors', Lang::$default, false); - Lang::load('index', Lang::$default, false); + Lang::load('General', Lang::$default, false); } // By default send 5 at once. diff --git a/Sources/PersonalMessage/PM.php b/Sources/PersonalMessage/PM.php index d32088f88b..e9a4b10450 100644 --- a/Sources/PersonalMessage/PM.php +++ b/Sources/PersonalMessage/PM.php @@ -632,9 +632,9 @@ public static function compose(): void if (Lang::$default === User::$me->language) { Utils::$context['response_prefix'] = Lang::$txt['response_prefix']; } else { - Lang::load('index', Lang::$default, false); + Lang::load('General', Lang::$default, false); Utils::$context['response_prefix'] = Lang::$txt['response_prefix']; - Lang::load('index'); + Lang::load('General'); } CacheApi::put('response_prefix', Utils::$context['response_prefix'], 600); @@ -1511,7 +1511,7 @@ public static function send(array $recipients, string $subject, string $message, // Censor and parse BBC in the receiver's language. Only do each language once. if (empty($notification_texts[$lang])) { if ($lang != User::$me->language) { - Lang::load('index+Modifications', $lang, false); + Lang::load('General+Modifications', $lang, false); } $notification_texts[$lang]['subject'] = $subject; @@ -1529,7 +1529,7 @@ public static function send(array $recipients, string $subject, string $message, } if ($lang != User::$me->language) { - Lang::load('index+Modifications', User::$me->language, false); + Lang::load('General+Modifications', User::$me->language, false); } } @@ -1546,7 +1546,7 @@ public static function send(array $recipients, string $subject, string $message, IntegrationHook::call('integrate_personal_message_after', [&$id_pm, &$log, &$recipients, &$from, &$subject, &$message]); // Back to what we were on before! - Lang::load('index+PersonalMessage'); + Lang::load('General+PersonalMessage'); // Add one to their unread and read message counts. foreach ($all_to as $k => $id) { diff --git a/Sources/TaskRunner.php b/Sources/TaskRunner.php index 8161e6d863..77e8583c94 100644 --- a/Sources/TaskRunner.php +++ b/Sources/TaskRunner.php @@ -176,7 +176,7 @@ public function __construct() $this->cleanRequest(); // Load the basic Lang::$txt strings. - Lang::load('index+Modifications'); + Lang::load('General+Modifications'); } } diff --git a/Sources/Tasks/CreatePost_Notify.php b/Sources/Tasks/CreatePost_Notify.php index 7cdf79ff9e..26b85be5c6 100644 --- a/Sources/Tasks/CreatePost_Notify.php +++ b/Sources/Tasks/CreatePost_Notify.php @@ -549,7 +549,7 @@ protected function handleWatchedNotifications(): void } // Censor and parse BBC in the receiver's localization. Don't repeat unnecessarily. - Lang::load('index+Modifications', $member_data['lngfile'], false); + Lang::load('General+Modifications', $member_data['lngfile'], false); $localization = implode('|', [$member_data['lngfile'], $member_data['time_offset'], $member_data['time_format']]); diff --git a/Sources/Tasks/ExportProfileData.php b/Sources/Tasks/ExportProfileData.php index 00aeedadcd..606e501b21 100644 --- a/Sources/Tasks/ExportProfileData.php +++ b/Sources/Tasks/ExportProfileData.php @@ -982,7 +982,7 @@ protected function exportXml(): void Theme::loadEssential(); Theme::$current->settings['actual_theme_dir'] = Theme::$current->settings['theme_dir']; User::$me->language = $lang; - Lang::load(implode('+', array_unique(['index', 'Modifications', 'Stats', 'Profile', $included[$datatype]['langfile']])), $lang); + Lang::load(implode('+', array_unique(['General', 'Modifications', 'Stats', 'Profile', $included[$datatype]['langfile']])), $lang); // @todo Ask lawyers whether the GDPR requires us to include posts in the recycle bin. $feed->query_this_board = '{query_see_message_board}' . (!empty(Config::$modSettings['recycle_enable']) && Config::$modSettings['recycle_board'] > 0 ? ' AND m.id_board != ' . Config::$modSettings['recycle_board'] : ''); diff --git a/Sources/Tasks/SendDigests.php b/Sources/Tasks/SendDigests.php index 694614dfa6..bc38b11b30 100644 --- a/Sources/Tasks/SendDigests.php +++ b/Sources/Tasks/SendDigests.php @@ -181,7 +181,7 @@ public function execute(): bool foreach ($langs as $lang) { Lang::load('Post', $lang); - Lang::load('index', $lang); + Lang::load('General', $lang); Lang::load('EmailTemplates', $lang); $langtxt[$lang] = [ diff --git a/Sources/Theme.php b/Sources/Theme.php index 126be70b84..ee558d1ca8 100644 --- a/Sources/Theme.php +++ b/Sources/Theme.php @@ -297,7 +297,7 @@ public static function loadEssential(): void Utils::$context['forum_name'] = Config::$mbname; Utils::$context['forum_name_html_safe'] = Utils::htmlspecialchars(Utils::$context['forum_name']); - Lang::load('index+Modifications'); + Lang::load('General+Modifications'); // Just in case it wasn't already set elsewhere. Utils::$context['character_set'] = empty(Config::$modSettings['global_character_set']) ? Lang::$txt['lang_character_set'] : Config::$modSettings['global_character_set']; @@ -1313,7 +1313,7 @@ public static function template_header(): void // If agreement is enabled, at least the english version shall exist if (!empty(Config::$modSettings['requireAgreement'])) { - $agreement = !file_exists(Config::$languagesdir . '/agreement.txt'); + $agreement = !file_exists(Config::$languagesdir . '/en-us/agreement.txt'); } // If privacy policy is enabled, at least the default language version shall exist @@ -2625,14 +2625,15 @@ protected function loadTemplatesAndLangFiles(): void // Output is fully XML, so no need for the index template. if (isset($_REQUEST['xml']) && (in_array(Utils::$context['current_action'], $this->xmlActions) || $requiresXML)) { - Lang::load('index+Modifications'); + { + Lang::load('General+Modifications'); self::loadTemplate('Xml'); Utils::$context['template_layers'] = []; } // These actions don't require the index template at all. elseif (!empty(Utils::$context['simple_action'])) { - Lang::load('index+Modifications'); + Lang::load('General+Modifications'); Utils::$context['template_layers'] = []; } else { // Custom templates to load, or just default? @@ -2648,8 +2649,7 @@ protected function loadTemplatesAndLangFiles(): void } // ...and attempt to load their associated language files. - $required_files = implode('+', array_merge($templates, ['Modifications'])); - Lang::load($required_files, '', false); + Lang::load('General+ThemeStrings+Modifications', '', false); // Custom template layers? if (isset($this->settings['theme_layers'])) { diff --git a/Sources/User.php b/Sources/User.php index c4a7d8e5b3..f3719f7ebf 100644 --- a/Sources/User.php +++ b/Sources/User.php @@ -1096,7 +1096,7 @@ public function format(bool $display_custom_fields = false): array { static $loadedLanguages = []; - Lang::load('index+Modifications'); + Lang::load('General+Modifications'); if (empty(Config::$modSettings['displayFields'])) { $display_custom_fields = false; diff --git a/Themes/default/languages/en-us/ThemeStrings.en-us.php b/Themes/default/languages/en-us/ThemeStrings.php similarity index 100% rename from Themes/default/languages/en-us/ThemeStrings.en-us.php rename to Themes/default/languages/en-us/ThemeStrings.php diff --git a/composer.lock b/composer.lock index 0ac5407bff..5520bf2207 100644 --- a/composer.lock +++ b/composer.lock @@ -4,283 +4,30 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "872641a4ede974af4756693d5f06b620", + "content-hash": "459367aef15bf2177bfed3beaacbe838", "packages": [], "packages-dev": [ { - "name": "composer/pcre", - "version": "3.1.1", + "name": "n98/junit-xml", + "version": "1.1.0", "source": { "type": "git", - "url": "https://github.com/composer/pcre.git", - "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9" + "url": "https://github.com/cmuench/junit-xml.git", + "reference": "0017dd92ac8cb619f02e32f4cffd768cfe327c73" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/00104306927c7a0919b4ced2aaa6782c1e61a3c9", - "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9", + "url": "https://api.github.com/repos/cmuench/junit-xml/zipball/0017dd92ac8cb619f02e32f4cffd768cfe327c73", + "reference": "0017dd92ac8cb619f02e32f4cffd768cfe327c73", "shasum": "" }, - "require": { - "php": "^7.4 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.3", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Pcre\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "PCRE wrapping library that offers type-safe preg_* replacements.", - "keywords": [ - "PCRE", - "preg", - "regex", - "regular expression" - ], - "support": { - "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.1" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2023-10-11T07:11:09+00:00" - }, - { - "name": "composer/semver", - "version": "3.4.0", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.4", - "symfony/phpunit-bridge": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ], - "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.0" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2023-08-31T09:50:34+00:00" - }, - { - "name": "composer/xdebug-handler", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "ced299686f41dce890debac69273b47ffe98a40c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", - "reference": "ced299686f41dce890debac69273b47ffe98a40c", - "shasum": "" - }, - "require": { - "composer/pcre": "^1 || ^2 || ^3", - "php": "^7.2.5 || ^8.0", - "psr/log": "^1 || ^2 || ^3" - }, "require-dev": { - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^6.0" + "phpunit/phpunit": "^9.5.0" }, "type": "library", "autoload": { "psr-4": { - "Composer\\XdebugHandler\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" - } - ], - "description": "Restarts a process without Xdebug.", - "keywords": [ - "Xdebug", - "performance" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-02-25T21:32:43+00:00" - }, - { - "name": "friendsofphp/php-cs-fixer", - "version": "v3.48.0", - "source": { - "type": "git", - "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "a92472c6fb66349de25211f31c77eceae3df024e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/a92472c6fb66349de25211f31c77eceae3df024e", - "reference": "a92472c6fb66349de25211f31c77eceae3df024e", - "shasum": "" - }, - "require": { - "composer/semver": "^3.4", - "composer/xdebug-handler": "^3.0.3", - "ext-filter": "*", - "ext-json": "*", - "ext-tokenizer": "*", - "php": "^7.4 || ^8.0", - "sebastian/diff": "^4.0 || ^5.0", - "symfony/console": "^5.4 || ^6.0 || ^7.0", - "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", - "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", - "symfony/finder": "^5.4 || ^6.0 || ^7.0", - "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0", - "symfony/polyfill-mbstring": "^1.28", - "symfony/polyfill-php80": "^1.28", - "symfony/polyfill-php81": "^1.28", - "symfony/process": "^5.4 || ^6.0 || ^7.0", - "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" - }, - "require-dev": { - "facile-it/paraunit": "^1.3 || ^2.0", - "justinrainbow/json-schema": "^5.2", - "keradus/cli-executor": "^2.1", - "mikey179/vfsstream": "^1.6.11", - "php-coveralls/php-coveralls": "^2.7", - "php-cs-fixer/accessible-object": "^1.1", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4", - "phpunit/phpunit": "^9.6 || ^10.5.5", - "symfony/yaml": "^5.4 || ^6.0 || ^7.0" - }, - "suggest": { - "ext-dom": "For handling output formats in XML", - "ext-mbstring": "For handling non-UTF8 characters." - }, - "bin": [ - "php-cs-fixer" - ], - "type": "application", - "autoload": { - "psr-4": { - "PhpCsFixer\\": "src/" + "N98\\JUnitXml\\": "src/N98/JUnitXml" } }, "notification-url": "https://packagist.org/downloads/", @@ -289,63 +36,44 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Dariusz Rumiński", - "email": "dariusz.ruminski@gmail.com" + "name": "Christian Münch", + "email": "c.muench@netz98.de" } ], - "description": "A tool to automatically fix PHP code style", - "keywords": [ - "Static code analysis", - "fixer", - "standards", - "static analysis" - ], + "description": "JUnit XML Document generation library", "support": { - "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.48.0" + "issues": "https://github.com/cmuench/junit-xml/issues", + "source": "https://github.com/cmuench/junit-xml/tree/1.1.0" }, - "funding": [ - { - "url": "https://github.com/keradus", - "type": "github" - } - ], - "time": "2024-01-19T21:44:39+00:00" + "time": "2020-12-25T09:08:58+00:00" }, { "name": "overtrue/phplint", - "version": "9.0.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/overtrue/phplint.git", - "reference": "da8aa332372fbbf9aed174ed45ad190aed848b9a" + "reference": "2d68ee8ab9083041a297cb6897ccec6290814c88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/overtrue/phplint/zipball/da8aa332372fbbf9aed174ed45ad190aed848b9a", - "reference": "da8aa332372fbbf9aed174ed45ad190aed848b9a", + "url": "https://api.github.com/repos/overtrue/phplint/zipball/2d68ee8ab9083041a297cb6897ccec6290814c88", + "reference": "2d68ee8ab9083041a297cb6897ccec6290814c88", "shasum": "" }, "require": { "ext-json": "*", - "php": "^8.0", - "symfony/cache": "^5.4 || ^6.0", - "symfony/console": "^5.4 || ^6.0", - "symfony/event-dispatcher": "^5.4 || ^6.0", - "symfony/finder": "^5.4 || ^6.0", - "symfony/options-resolver": "^5.4 || ^6.0", - "symfony/process": "^5.4 || ^6.0", - "symfony/yaml": "^5.4 || ^6.0" + "n98/junit-xml": "1.1.0", + "php": ">=5.5.9", + "symfony/console": "^3.2|^4.0|^5.0", + "symfony/finder": "^3.0|^4.0|^5.0", + "symfony/process": "^3.3|^4.0|^5.0", + "symfony/yaml": "^3.0|^4.0|^5.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4", - "brainmaestro/composer-git-hooks": "^2.8.5 || 3.0.0-alpha.1", - "jetbrains/phpstorm-stubs": "^2021.3 || ^2022.3", - "php-parallel-lint/php-console-highlighter": "^1.0" + "brainmaestro/composer-git-hooks": "^2.7", + "friendsofphp/php-cs-fixer": "^2.16", + "jakub-onderka/php-console-highlighter": "^0.3.2 || ^0.4" }, "bin": [ "bin/phplint" @@ -355,10 +83,10 @@ "hooks": { "pre-commit": [ "composer fix-style" + ], + "pre-push": [ + "composer check-style" ] - }, - "branch-alias": { - "dev-main": "9.0.x-dev" } }, "autoload": { @@ -368,1557 +96,54 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" - ], - "authors": [ - { - "name": "overtrue", - "email": "anzhengchao@gmail.com" - }, - { - "name": "Laurent Laville", - "homepage": "https://github.com/llaville" - } - ], - "description": "`phplint` is a tool that can speed up linting of php files by running several lint processes at once.", - "keywords": [ - "check", - "lint", - "phplint", - "syntax" - ], - "support": { - "issues": "https://github.com/overtrue/phplint/issues", - "source": "https://github.com/overtrue/phplint/tree/9.0.4" - }, - "funding": [ - { - "url": "https://github.com/overtrue", - "type": "github" - } - ], - "time": "2023-02-23T15:46:09+00:00" - }, - { - "name": "psr/cache", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "213f9dbc5b9bfbc4f8db86d2838dc968752ce13b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/213f9dbc5b9bfbc4f8db86d2838dc968752ce13b", - "reference": "213f9dbc5b9bfbc4f8db86d2838dc968752ce13b", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for caching libraries", - "keywords": [ - "cache", - "psr", - "psr-6" - ], - "support": { - "source": "https://github.com/php-fig/cache/tree/2.0.0" - }, - "time": "2021-02-03T23:23:37+00:00" - }, - { - "name": "psr/container", - "version": "1.1.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", - "shasum": "" - }, - "require": { - "php": ">=7.4.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.2" - }, - "time": "2021-11-05T16:50:12+00:00" - }, - { - "name": "psr/event-dispatcher", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/event-dispatcher.git", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", - "shasum": "" - }, - "require": { - "php": ">=7.2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\EventDispatcher\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Standard interfaces for event handling.", - "keywords": [ - "events", - "psr", - "psr-14" - ], - "support": { - "issues": "https://github.com/php-fig/event-dispatcher/issues", - "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" - }, - "time": "2019-01-08T18:20:26+00:00" - }, - { - "name": "psr/log", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/ef29f6d262798707a9edd554e2b82517ef3a9376", - "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/2.0.0" - }, - "time": "2021-07-14T16:41:46+00:00" - }, - { - "name": "sebastian/diff", - "version": "4.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3", - "symfony/process": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-05-07T05:35:17+00:00" - }, - { - "name": "simplemachines/build-tools", - "version": "dev-release-3.0", - "source": { - "type": "git", - "url": "https://github.com/SimpleMachines/BuildTools.git", - "reference": "09ee356ced8c086af7d264db918459f39513769e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/SimpleMachines/BuildTools/zipball/09ee356ced8c086af7d264db918459f39513769e", - "reference": "09ee356ced8c086af7d264db918459f39513769e", - "shasum": "" - }, - "require": { - "overtrue/phplint": "9.0.4", - "php": ">=8.0" - }, - "default-branch": true, - "type": "library", - "support": { - "source": "https://github.com/SimpleMachines/BuildTools/tree/release-3.0", - "issues": "https://github.com/SimpleMachines/BuildTools/issues" - }, - "time": "2023-12-24T13:03:30+00:00" - }, - { - "name": "symfony/cache", - "version": "v5.4.34", - "source": { - "type": "git", - "url": "https://github.com/symfony/cache.git", - "reference": "b17f28169f7a2f2c0cddf2b044d729f5b75efe5a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/b17f28169f7a2f2c0cddf2b044d729f5b75efe5a", - "reference": "b17f28169f7a2f2c0cddf2b044d729f5b75efe5a", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "psr/cache": "^1.0|^2.0", - "psr/log": "^1.1|^2|^3", - "symfony/cache-contracts": "^1.1.7|^2", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/var-exporter": "^4.4|^5.0|^6.0" - }, - "conflict": { - "doctrine/dbal": "<2.13.1", - "symfony/dependency-injection": "<4.4", - "symfony/http-kernel": "<4.4", - "symfony/var-dumper": "<4.4" - }, - "provide": { - "psr/cache-implementation": "1.0|2.0", - "psr/simple-cache-implementation": "1.0|2.0", - "symfony/cache-implementation": "1.0|2.0" - }, - "require-dev": { - "cache/integration-tests": "dev-master", - "doctrine/cache": "^1.6|^2.0", - "doctrine/dbal": "^2.13.1|^3|^4", - "predis/predis": "^1.1", - "psr/simple-cache": "^1.0|^2.0", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/filesystem": "^4.4|^5.0|^6.0", - "symfony/http-kernel": "^4.4|^5.0|^6.0", - "symfony/messenger": "^4.4|^5.0|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Cache\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides extended PSR-6, PSR-16 (and tags) implementations", - "homepage": "https://symfony.com", - "keywords": [ - "caching", - "psr6" - ], - "support": { - "source": "https://github.com/symfony/cache/tree/v5.4.34" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-12-18T14:56:06+00:00" - }, - { - "name": "symfony/cache-contracts", - "version": "v2.5.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/cache-contracts.git", - "reference": "64be4a7acb83b6f2bf6de9a02cee6dad41277ebc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/64be4a7acb83b6f2bf6de9a02cee6dad41277ebc", - "reference": "64be4a7acb83b6f2bf6de9a02cee6dad41277ebc", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "psr/cache": "^1.0|^2.0|^3.0" - }, - "suggest": { - "symfony/cache-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Cache\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to caching", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/cache-contracts/tree/v2.5.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-01-02T09:53:40+00:00" - }, - { - "name": "symfony/console", - "version": "v5.4.34", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "4b4d8cd118484aa604ec519062113dd87abde18c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/4b4d8cd118484aa604ec519062113dd87abde18c", - "reference": "4b4d8cd118484aa604ec519062113dd87abde18c", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.1|^6.0" - }, - "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" - }, - "provide": { - "psr/log-implementation": "1.0|2.0" - }, - "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/lock": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Eases the creation of beautiful and testable command line interfaces", - "homepage": "https://symfony.com", - "keywords": [ - "cli", - "command-line", - "console", - "terminal" - ], - "support": { - "source": "https://github.com/symfony/console/tree/v5.4.34" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-12-08T13:33:03+00:00" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v2.5.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-01-02T09:53:40+00:00" - }, - { - "name": "symfony/event-dispatcher", - "version": "v5.4.34", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "e3bca343efeb613f843c254e7718ef17c9bdf7a3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/e3bca343efeb613f843c254e7718ef17c9bdf7a3", - "reference": "e3bca343efeb613f843c254e7718ef17c9bdf7a3", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/event-dispatcher-contracts": "^2|^3", - "symfony/polyfill-php80": "^1.16" - }, - "conflict": { - "symfony/dependency-injection": "<4.4" - }, - "provide": { - "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "2.0" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^4.4|^5.0|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/stopwatch": "^4.4|^5.0|^6.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.34" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-12-27T21:12:56+00:00" - }, - { - "name": "symfony/event-dispatcher-contracts", - "version": "v2.5.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/f98b54df6ad059855739db6fcbc2d36995283fe1", - "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "psr/event-dispatcher": "^1" - }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\EventDispatcher\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to dispatching event", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-01-02T09:53:40+00:00" - }, - { - "name": "symfony/filesystem", - "version": "v5.4.25", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "0ce3a62c9579a53358d3a7eb6b3dfb79789a6364" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/0ce3a62c9579a53358d3a7eb6b3dfb79789a6364", - "reference": "0ce3a62c9579a53358d3a7eb6b3dfb79789a6364", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides basic utilities for the filesystem", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.25" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-05-31T13:04:02+00:00" - }, - { - "name": "symfony/finder", - "version": "v5.4.27", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "ff4bce3c33451e7ec778070e45bd23f74214cd5d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/ff4bce3c33451e7ec778070e45bd23f74214cd5d", - "reference": "ff4bce3c33451e7ec778070e45bd23f74214cd5d", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Finds files and directories via an intuitive fluent interface", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.27" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-07-31T08:02:31+00:00" - }, - { - "name": "symfony/options-resolver", - "version": "v5.4.21", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9", - "reference": "4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php73": "~1.0", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an improved replacement for the array_replace PHP function", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" - ], - "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.4.21" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-02-14T08:03:56+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-26T09:26:14+00:00" - }, - { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "875e90aeea2777b6f135677f618529449334a612" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", - "reference": "875e90aeea2777b6f135677f618529449334a612", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's grapheme_* functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "grapheme", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-26T09:26:14+00:00" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-26T09:26:14+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "42292d99c55abe617799667f454222c54c60e229" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", - "reference": "42292d99c55abe617799667f454222c54c60e229", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-07-28T09:04:16+00:00" - }, - { - "name": "symfony/polyfill-php73", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fe2f306d1d9d346a7fee353d0d5012e401e984b5", - "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-26T09:26:14+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, + "MIT" + ], + "authors": [ { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "overtrue", + "email": "anzhengchao@gmail.com" } ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", + "description": "`phplint` is a tool that can speed up linting of php files by running several lint processes at once.", "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" + "check", + "lint", + "phplint", + "syntax" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" + "issues": "https://github.com/overtrue/phplint/issues", + "source": "https://github.com/overtrue/phplint/tree/3.0.0" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2021-06-02T13:27:41+00:00" }, { - "name": "symfony/polyfill-php81", - "version": "v1.28.0", + "name": "psr/log", + "version": "1.1.4", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", - "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "dev-master": "1.1.x-dev" } }, "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { - "Symfony\\Polyfill\\Php81\\": "" - }, - "classmap": [ - "Resources/stubs" - ] + "Psr\\Log\\": "Psr/Log/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1926,63 +151,93 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", - "homepage": "https://symfony.com", + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" + "log", + "psr", + "psr-3" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0" + "source": "https://github.com/php-fig/log/tree/1.1.4" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2021-05-03T11:20:27+00:00" }, { - "name": "symfony/process", - "version": "v5.4.34", + "name": "simplemachines/build-tools", + "version": "dev-master", "source": { "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "8fa22178dfc368911dbd513b431cd9b06f9afe7a" + "url": "https://github.com/SimpleMachines/BuildTools.git", + "reference": "21362ca18695da7e0c31260c62fa5e524b6c93bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/SimpleMachines/BuildTools/zipball/21362ca18695da7e0c31260c62fa5e524b6c93bc", + "reference": "21362ca18695da7e0c31260c62fa5e524b6c93bc", + "shasum": "" + }, + "require": { + "overtrue/phplint": "3.0" + }, + "default-branch": true, + "type": "library", + "support": { + "source": "https://github.com/SimpleMachines/BuildTools/tree/master", + "issues": "https://github.com/SimpleMachines/BuildTools/issues" + }, + "time": "2023-11-11T16:22:30+00:00" + }, + { + "name": "symfony/console", + "version": "v3.3.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "b0878233cb5c4391347e5495089c7af11b8e6201" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/8fa22178dfc368911dbd513b431cd9b06f9afe7a", - "reference": "8fa22178dfc368911dbd513b431cd9b06f9afe7a", + "url": "https://api.github.com/repos/symfony/console/zipball/b0878233cb5c4391347e5495089c7af11b8e6201", + "reference": "b0878233cb5c4391347e5495089c7af11b8e6201", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" + "php": ">=5.5.9", + "symfony/debug": "~2.8|~3.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.3", + "symfony/dependency-injection": "~3.3", + "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/filesystem": "~2.8|~3.0", + "symfony/http-kernel": "~2.8|~3.0", + "symfony/process": "~2.8|~3.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/filesystem": "", + "symfony/process": "" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, "autoload": { "psr-4": { - "Symfony\\Component\\Process\\": "" + "Symfony\\Component\\Console\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -2002,66 +257,50 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Executes commands in sub-processes", + "description": "Symfony Console Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.34" + "source": "https://github.com/symfony/console/tree/3.3" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-12-02T08:41:43+00:00" + "time": "2017-07-29T21:27:59+00:00" }, { - "name": "symfony/service-contracts", - "version": "v2.5.2", + "name": "symfony/debug", + "version": "v3.3.6", "source": { "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c" + "url": "https://github.com/symfony/debug.git", + "reference": "7c13ae8ce1e2adbbd574fc39de7be498e1284e13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c", + "url": "https://api.github.com/repos/symfony/debug/zipball/7c13ae8ce1e2adbbd574fc39de7be498e1284e13", + "reference": "7c13ae8ce1e2adbbd574fc39de7be498e1284e13", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1|^3" + "php": ">=5.5.9", + "psr/log": "~1.0" }, "conflict": { - "ext-psr": "<1.1|>=2" + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" }, - "suggest": { - "symfony/service-implementation": "" + "require-dev": { + "symfony/http-kernel": "~2.8|~3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "dev-master": "3.3-dev" } }, "autoload": { "psr-4": { - "Symfony\\Contracts\\Service\\": "" - } + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2069,65 +308,48 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Generic abstractions related to writing services", + "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/debug/tree/3.3" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-05-30T19:17:29+00:00" + "abandoned": "symfony/error-handler", + "time": "2017-07-28T15:27:31+00:00" }, { - "name": "symfony/stopwatch", - "version": "v5.4.21", + "name": "symfony/finder", + "version": "v3.3.6", "source": { "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "f83692cd869a6f2391691d40a01e8acb89e76fee" + "url": "https://github.com/symfony/finder.git", + "reference": "baea7f66d30854ad32988c11a09d7ffd485810c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/f83692cd869a6f2391691d40a01e8acb89e76fee", - "reference": "f83692cd869a6f2391691d40a01e8acb89e76fee", + "url": "https://api.github.com/repos/symfony/finder/zipball/baea7f66d30854ad32988c11a09d7ffd485810c4", + "reference": "baea7f66d30854ad32988c11a09d7ffd485810c4", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/service-contracts": "^1|^2|^3" + "php": ">=5.5.9" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, "autoload": { "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" + "Symfony\\Component\\Finder\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -2147,69 +369,50 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Provides a way to profile code", + "description": "Symfony Finder Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.4.21" + "source": "https://github.com/symfony/finder/tree/3.3" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-02-14T08:03:56+00:00" + "time": "2017-06-01T21:01:25+00:00" }, { - "name": "symfony/string", - "version": "v5.4.34", + "name": "symfony/polyfill-mbstring", + "version": "v1.19.0", "source": { "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "e3f98bfc7885c957488f443df82d97814a3ce061" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "b5f7b932ee6fa802fc792eabd77c4c88084517ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/e3f98bfc7885c957488f443df82d97814a3ce061", - "reference": "e3f98bfc7885c957488f443df82d97814a3ce061", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b5f7b932ee6fa802fc792eabd77c4c88084517ce", + "reference": "b5f7b932ee6fa802fc792eabd77c4c88084517ce", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "~1.15" - }, - "conflict": { - "symfony/translation-contracts": ">=3.0" + "php": ">=5.3.3" }, - "require-dev": { - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/translation-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.4|^5.0|^6.0" + "suggest": { + "ext-mbstring": "For best performance" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.19-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, "autoload": { "files": [ - "Resources/functions.php" + "bootstrap.php" ], "psr-4": { - "Symfony\\Component\\String\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2225,18 +428,17 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "description": "Symfony polyfill for the Mbstring extension", "homepage": "https://symfony.com", "keywords": [ - "grapheme", - "i18n", - "string", - "unicode", - "utf-8", - "utf8" + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.34" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.19.0" }, "funding": [ { @@ -2252,33 +454,34 @@ "type": "tidelift" } ], - "time": "2023-12-09T13:20:28+00:00" + "time": "2020-10-23T09:01:57+00:00" }, { - "name": "symfony/var-exporter", - "version": "v5.4.32", + "name": "symfony/process", + "version": "v3.3.6", "source": { "type": "git", - "url": "https://github.com/symfony/var-exporter.git", - "reference": "fdb022f0d3d41df240c18e2eb9a117c430f06add" + "url": "https://github.com/symfony/process.git", + "reference": "07432804942b9f6dd7b7377faf9920af5f95d70a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/fdb022f0d3d41df240c18e2eb9a117c430f06add", - "reference": "fdb022f0d3d41df240c18e2eb9a117c430f06add", + "url": "https://api.github.com/repos/symfony/process/zipball/07432804942b9f6dd7b7377faf9920af5f95d70a", + "reference": "07432804942b9f6dd7b7377faf9920af5f95d70a", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" - }, - "require-dev": { - "symfony/var-dumper": "^4.4.9|^5.0.9|^6.0" + "php": ">=5.5.9" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, "autoload": { "psr-4": { - "Symfony\\Component\\VarExporter\\": "" + "Symfony\\Component\\Process\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -2290,75 +493,50 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Allows exporting any serializable PHP data structure to plain PHP code", + "description": "Symfony Process Component", "homepage": "https://symfony.com", - "keywords": [ - "clone", - "construct", - "export", - "hydrate", - "instantiate", - "serialize" - ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v5.4.32" + "source": "https://github.com/symfony/process/tree/3.3" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-11-16T19:33:05+00:00" + "time": "2017-07-13T13:05:09+00:00" }, { "name": "symfony/yaml", - "version": "v5.4.31", + "version": "v3.3.6", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "f387675d7f5fc4231f7554baa70681f222f73563" + "reference": "ddc23324e6cfe066f3dd34a37ff494fa80b617ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/f387675d7f5fc4231f7554baa70681f222f73563", - "reference": "f387675d7f5fc4231f7554baa70681f222f73563", + "url": "https://api.github.com/repos/symfony/yaml/zipball/ddc23324e6cfe066f3dd34a37ff494fa80b617ed", + "reference": "ddc23324e6cfe066f3dd34a37ff494fa80b617ed", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "symfony/console": "<5.3" + "php": ">=5.5.9" }, "require-dev": { - "symfony/console": "^5.3|^6.0" + "symfony/console": "~2.8|~3.0" }, "suggest": { "symfony/console": "For validating YAML files using the lint command" }, - "bin": [ - "Resources/bin/yaml-lint" - ], "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, "autoload": { "psr-4": { "Symfony\\Component\\Yaml\\": "" @@ -2381,26 +559,12 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Loads and dumps YAML files", + "description": "Symfony Yaml Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v5.4.31" + "source": "https://github.com/symfony/yaml/tree/3.3" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-11-03T14:41:28+00:00" + "time": "2017-07-23T12:43:26+00:00" } ], "aliases": [], @@ -2413,7 +577,7 @@ "platform": [], "platform-dev": [], "platform-overrides": { - "php": "8.0.0" + "php": "7.0.2" }, "plugin-api-version": "2.6.0" } diff --git a/other/upgrade.php b/other/upgrade.php index f729fff7d9..214dc13e8f 100644 --- a/other/upgrade.php +++ b/other/upgrade.php @@ -695,7 +695,7 @@ function load_lang_file() Lang::addDirs($lang_dir); // And now load the language files. - Lang::load('index+Install', preg_replace('~^Install\.|\.php$~', '', $_SESSION['upgrader_langfile'])); + Lang::load('General+Install', preg_replace('~^Install\.|\.php$~', '', $_SESSION['upgrader_langfile'])); // Remember what we've done $loaded_langfile = $lang_dir . '/' . $_SESSION['upgrader_langfile']; From 46b09ce53c058a1eb3824067364ea4d9487e7ebf Mon Sep 17 00:00:00 2001 From: jdarwood007 Date: Sat, 11 Nov 2023 08:32:16 -0800 Subject: [PATCH 09/35] Debug info needs to make more sense --- Sources/Lang.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Sources/Lang.php b/Sources/Lang.php index 2595ef6118..f70f311c24 100644 --- a/Sources/Lang.php +++ b/Sources/Lang.php @@ -260,6 +260,9 @@ public static function load(string $template_name, string $lang = '', bool $fata ErrorHandler::log(sprintf(self::$txt['theme_language_error'] ?? 'Unable to load the \'%1$s\' language file.', $template_name . '.' . $lang, 'template')); break; } + // Keep track of what we're up to, soldier. + elseif (!empty(Config::$db_show_debug)) + Utils::$context['debug']['language_files'][] = $file[2] . '.' . $file[1] . ' (' . (Config::$languagesdir == $file[0] ? 'Base' : basename(Theme::$current->settings['theme_url'] ?? 'unknown')) . ')'; // Copyright can't be empty. if (empty(self::$forum_copyright)) { @@ -290,11 +293,6 @@ public static function load(string $template_name, string $lang = '', bool $fata } } - // Keep track of what we're up to, soldier. - if (!empty(Config::$db_show_debug)) { - Utils::$context['debug']['language_files'][] = $template_name . '.' . $lang . ' (' . basename(Theme::$current->settings['theme_url'] ?? 'unknown') . ')'; - } - // Remember what we have loaded, and in which language. self::$already_loaded[$template_name] = $lang; From 78f6a7c0de2dcc03cd8fb76acf6b2bcbe35e3753 Mon Sep 17 00:00:00 2001 From: jdarwood007 Date: Sat, 11 Nov 2023 11:10:46 -0800 Subject: [PATCH 10/35] Use the canonical form Check the agent accept language for a possible match. --- Languages/{en-us => en_US}/Admin.php | 0 Languages/{en-us => en_US}/Agreement.php | 0 Languages/{en-us => en_US}/Alerts.php | 0 Languages/{en-us => en_US}/Drafts.php | 0 Languages/{en-us => en_US}/Editor.php | 0 Languages/{en-us => en_US}/EmailTemplates.php | 0 Languages/{en-us => en_US}/Errors.php | 0 Languages/{en-us => en_US}/General.php | 0 Languages/{en-us => en_US}/Help.php | 0 Languages/{en-us => en_US}/Install.php | 0 Languages/{en-us => en_US}/Login.php | 0 Languages/{en-us => en_US}/ManageBoards.php | 0 Languages/{en-us => en_US}/ManageCalendar.php | 0 Languages/{en-us => en_US}/ManageMail.php | 0 Languages/{en-us => en_US}/ManageMaintenance.php | 0 Languages/{en-us => en_US}/ManageMembers.php | 0 Languages/{en-us => en_US}/ManagePaid.php | 0 Languages/{en-us => en_US}/ManagePermissions.php | 0 .../{en-us => en_US}/ManageScheduledTasks.php | 0 Languages/{en-us => en_US}/ManageSettings.php | 0 Languages/{en-us => en_US}/ManageSmileys.php | 0 Languages/{en-us => en_US}/Manual.php | 0 Languages/{en-us => en_US}/ModerationCenter.php | 0 Languages/{en-us => en_US}/Modifications.php | 0 Languages/{en-us => en_US}/Modlog.php | 0 Languages/{en-us => en_US}/Packages.php | 0 Languages/{en-us => en_US}/PersonalMessage.php | 0 Languages/{en-us => en_US}/Post.php | 0 Languages/{en-us => en_US}/Profile.php | 0 Languages/{en-us => en_US}/Reports.php | 0 Languages/{en-us => en_US}/Search.php | 0 Languages/{en-us => en_US}/Stats.php | 0 Languages/{en-us => en_US}/Themes.php | 0 Languages/{en-us => en_US}/Timezones.php | 0 Languages/{en-us => en_US}/Who.php | 0 Languages/en_US/agreement.txt | 13 +++++++++++++ Languages/{en-us => en_US}/index.php | 0 Sources/Actions/Admin/Languages.php | 4 ++-- Sources/Actions/Admin/Themes.php | 2 +- Sources/Actions/Agreement.php | 4 ++-- Sources/Lang.php | 8 ++++---- Sources/Theme.php | 3 +-- Sources/User.php | 14 ++++++++++++++ .../languages/{en-us => en_US}/ThemeStrings.php | 0 .../default/languages/{en-us => en_US}/index.php | 0 composer.lock | 8 ++++---- other/install.php | 4 ++-- other/upgrade.php | 10 +++++----- 48 files changed, 48 insertions(+), 22 deletions(-) rename Languages/{en-us => en_US}/Admin.php (100%) rename Languages/{en-us => en_US}/Agreement.php (100%) rename Languages/{en-us => en_US}/Alerts.php (100%) rename Languages/{en-us => en_US}/Drafts.php (100%) rename Languages/{en-us => en_US}/Editor.php (100%) rename Languages/{en-us => en_US}/EmailTemplates.php (100%) rename Languages/{en-us => en_US}/Errors.php (100%) rename Languages/{en-us => en_US}/General.php (100%) rename Languages/{en-us => en_US}/Help.php (100%) rename Languages/{en-us => en_US}/Install.php (100%) rename Languages/{en-us => en_US}/Login.php (100%) rename Languages/{en-us => en_US}/ManageBoards.php (100%) rename Languages/{en-us => en_US}/ManageCalendar.php (100%) rename Languages/{en-us => en_US}/ManageMail.php (100%) rename Languages/{en-us => en_US}/ManageMaintenance.php (100%) rename Languages/{en-us => en_US}/ManageMembers.php (100%) rename Languages/{en-us => en_US}/ManagePaid.php (100%) rename Languages/{en-us => en_US}/ManagePermissions.php (100%) rename Languages/{en-us => en_US}/ManageScheduledTasks.php (100%) rename Languages/{en-us => en_US}/ManageSettings.php (100%) rename Languages/{en-us => en_US}/ManageSmileys.php (100%) rename Languages/{en-us => en_US}/Manual.php (100%) rename Languages/{en-us => en_US}/ModerationCenter.php (100%) rename Languages/{en-us => en_US}/Modifications.php (100%) rename Languages/{en-us => en_US}/Modlog.php (100%) rename Languages/{en-us => en_US}/Packages.php (100%) rename Languages/{en-us => en_US}/PersonalMessage.php (100%) rename Languages/{en-us => en_US}/Post.php (100%) rename Languages/{en-us => en_US}/Profile.php (100%) rename Languages/{en-us => en_US}/Reports.php (100%) rename Languages/{en-us => en_US}/Search.php (100%) rename Languages/{en-us => en_US}/Stats.php (100%) rename Languages/{en-us => en_US}/Themes.php (100%) rename Languages/{en-us => en_US}/Timezones.php (100%) rename Languages/{en-us => en_US}/Who.php (100%) create mode 100644 Languages/en_US/agreement.txt rename Languages/{en-us => en_US}/index.php (100%) rename Themes/default/languages/{en-us => en_US}/ThemeStrings.php (100%) rename Themes/default/languages/{en-us => en_US}/index.php (100%) diff --git a/Languages/en-us/Admin.php b/Languages/en_US/Admin.php similarity index 100% rename from Languages/en-us/Admin.php rename to Languages/en_US/Admin.php diff --git a/Languages/en-us/Agreement.php b/Languages/en_US/Agreement.php similarity index 100% rename from Languages/en-us/Agreement.php rename to Languages/en_US/Agreement.php diff --git a/Languages/en-us/Alerts.php b/Languages/en_US/Alerts.php similarity index 100% rename from Languages/en-us/Alerts.php rename to Languages/en_US/Alerts.php diff --git a/Languages/en-us/Drafts.php b/Languages/en_US/Drafts.php similarity index 100% rename from Languages/en-us/Drafts.php rename to Languages/en_US/Drafts.php diff --git a/Languages/en-us/Editor.php b/Languages/en_US/Editor.php similarity index 100% rename from Languages/en-us/Editor.php rename to Languages/en_US/Editor.php diff --git a/Languages/en-us/EmailTemplates.php b/Languages/en_US/EmailTemplates.php similarity index 100% rename from Languages/en-us/EmailTemplates.php rename to Languages/en_US/EmailTemplates.php diff --git a/Languages/en-us/Errors.php b/Languages/en_US/Errors.php similarity index 100% rename from Languages/en-us/Errors.php rename to Languages/en_US/Errors.php diff --git a/Languages/en-us/General.php b/Languages/en_US/General.php similarity index 100% rename from Languages/en-us/General.php rename to Languages/en_US/General.php diff --git a/Languages/en-us/Help.php b/Languages/en_US/Help.php similarity index 100% rename from Languages/en-us/Help.php rename to Languages/en_US/Help.php diff --git a/Languages/en-us/Install.php b/Languages/en_US/Install.php similarity index 100% rename from Languages/en-us/Install.php rename to Languages/en_US/Install.php diff --git a/Languages/en-us/Login.php b/Languages/en_US/Login.php similarity index 100% rename from Languages/en-us/Login.php rename to Languages/en_US/Login.php diff --git a/Languages/en-us/ManageBoards.php b/Languages/en_US/ManageBoards.php similarity index 100% rename from Languages/en-us/ManageBoards.php rename to Languages/en_US/ManageBoards.php diff --git a/Languages/en-us/ManageCalendar.php b/Languages/en_US/ManageCalendar.php similarity index 100% rename from Languages/en-us/ManageCalendar.php rename to Languages/en_US/ManageCalendar.php diff --git a/Languages/en-us/ManageMail.php b/Languages/en_US/ManageMail.php similarity index 100% rename from Languages/en-us/ManageMail.php rename to Languages/en_US/ManageMail.php diff --git a/Languages/en-us/ManageMaintenance.php b/Languages/en_US/ManageMaintenance.php similarity index 100% rename from Languages/en-us/ManageMaintenance.php rename to Languages/en_US/ManageMaintenance.php diff --git a/Languages/en-us/ManageMembers.php b/Languages/en_US/ManageMembers.php similarity index 100% rename from Languages/en-us/ManageMembers.php rename to Languages/en_US/ManageMembers.php diff --git a/Languages/en-us/ManagePaid.php b/Languages/en_US/ManagePaid.php similarity index 100% rename from Languages/en-us/ManagePaid.php rename to Languages/en_US/ManagePaid.php diff --git a/Languages/en-us/ManagePermissions.php b/Languages/en_US/ManagePermissions.php similarity index 100% rename from Languages/en-us/ManagePermissions.php rename to Languages/en_US/ManagePermissions.php diff --git a/Languages/en-us/ManageScheduledTasks.php b/Languages/en_US/ManageScheduledTasks.php similarity index 100% rename from Languages/en-us/ManageScheduledTasks.php rename to Languages/en_US/ManageScheduledTasks.php diff --git a/Languages/en-us/ManageSettings.php b/Languages/en_US/ManageSettings.php similarity index 100% rename from Languages/en-us/ManageSettings.php rename to Languages/en_US/ManageSettings.php diff --git a/Languages/en-us/ManageSmileys.php b/Languages/en_US/ManageSmileys.php similarity index 100% rename from Languages/en-us/ManageSmileys.php rename to Languages/en_US/ManageSmileys.php diff --git a/Languages/en-us/Manual.php b/Languages/en_US/Manual.php similarity index 100% rename from Languages/en-us/Manual.php rename to Languages/en_US/Manual.php diff --git a/Languages/en-us/ModerationCenter.php b/Languages/en_US/ModerationCenter.php similarity index 100% rename from Languages/en-us/ModerationCenter.php rename to Languages/en_US/ModerationCenter.php diff --git a/Languages/en-us/Modifications.php b/Languages/en_US/Modifications.php similarity index 100% rename from Languages/en-us/Modifications.php rename to Languages/en_US/Modifications.php diff --git a/Languages/en-us/Modlog.php b/Languages/en_US/Modlog.php similarity index 100% rename from Languages/en-us/Modlog.php rename to Languages/en_US/Modlog.php diff --git a/Languages/en-us/Packages.php b/Languages/en_US/Packages.php similarity index 100% rename from Languages/en-us/Packages.php rename to Languages/en_US/Packages.php diff --git a/Languages/en-us/PersonalMessage.php b/Languages/en_US/PersonalMessage.php similarity index 100% rename from Languages/en-us/PersonalMessage.php rename to Languages/en_US/PersonalMessage.php diff --git a/Languages/en-us/Post.php b/Languages/en_US/Post.php similarity index 100% rename from Languages/en-us/Post.php rename to Languages/en_US/Post.php diff --git a/Languages/en-us/Profile.php b/Languages/en_US/Profile.php similarity index 100% rename from Languages/en-us/Profile.php rename to Languages/en_US/Profile.php diff --git a/Languages/en-us/Reports.php b/Languages/en_US/Reports.php similarity index 100% rename from Languages/en-us/Reports.php rename to Languages/en_US/Reports.php diff --git a/Languages/en-us/Search.php b/Languages/en_US/Search.php similarity index 100% rename from Languages/en-us/Search.php rename to Languages/en_US/Search.php diff --git a/Languages/en-us/Stats.php b/Languages/en_US/Stats.php similarity index 100% rename from Languages/en-us/Stats.php rename to Languages/en_US/Stats.php diff --git a/Languages/en-us/Themes.php b/Languages/en_US/Themes.php similarity index 100% rename from Languages/en-us/Themes.php rename to Languages/en_US/Themes.php diff --git a/Languages/en-us/Timezones.php b/Languages/en_US/Timezones.php similarity index 100% rename from Languages/en-us/Timezones.php rename to Languages/en_US/Timezones.php diff --git a/Languages/en-us/Who.php b/Languages/en_US/Who.php similarity index 100% rename from Languages/en-us/Who.php rename to Languages/en_US/Who.php diff --git a/Languages/en_US/agreement.txt b/Languages/en_US/agreement.txt new file mode 100644 index 0000000000..e500878631 --- /dev/null +++ b/Languages/en_US/agreement.txt @@ -0,0 +1,13 @@ +You agree, through your use of this forum, that you will not post any material which is false, defamatory, inaccurate, abusive, vulgar, hateful, harassing, obscene, profane, sexually oriented, threatening, invasive of a person's privacy, adult material, or otherwise in violation of any International or United States Federal law. You also agree not to post any copyrighted material unless you own the copyright or you have written consent from the owner of the copyrighted material. Spam, flooding, advertisements, chain letters, pyramid schemes, and solicitations are also forbidden on this forum. + +Note that it is impossible for the staff or the owners of this forum to confirm the validity of posts. Please remember that we do not actively monitor the posted messages, and as such, are not responsible for the content contained within. We do not warrant the accuracy, completeness, or usefulness of any information presented. The posted messages express the views of the author, and not necessarily the views of this forum, its staff, its subsidiaries, or this forum's owner. Anyone who feels that a posted message is objectionable is encouraged to notify an administrator or moderator of this forum immediately. The staff and the owner of this forum reserve the right to remove objectionable content, within a reasonable time frame, if they determine that removal is necessary. This is a manual process, however, please realize that they may not be able to remove or edit particular messages immediately. This policy applies to member profile information as well. + +You remain solely responsible for the content of your posted messages. Furthermore, you agree to indemnify and hold harmless the owners of this forum, any related websites to this forum, its staff, and its subsidiaries. The owners of this forum also reserve the right to reveal your identity (or any other related information collected on this service) in the event of a formal complaint or legal action arising from any situation caused by your use of this forum. + +You have the ability, as you register, to choose your username. We advise that you keep the name appropriate. With this user account you are about to register, you agree to never give your password out to another person except an administrator, for your protection and for validity reasons. You also agree to NEVER use another person's account for any reason. We also HIGHLY recommend you use a complex and unique password for your account, to prevent account theft. + +After you register and login to this forum, you will be able to fill out a detailed profile. It is your responsibility to present clean and accurate information. Any information the forum owner or staff determines to be inaccurate or vulgar in nature will be removed, with or without prior notice. Appropriate sanctions may be applicable. + +Please note that with each post, your IP address is recorded, in the event that you need to be banned from this forum or your ISP contacted. This will only happen in the event of a major violation of this agreement. + +Also note that the software places a cookie, a text file containing bits of information (such as your username and password), in your browser's cache. This is ONLY used to keep you logged in/out. The software does not collect or send any other form of information to your computer. \ No newline at end of file diff --git a/Languages/en-us/index.php b/Languages/en_US/index.php similarity index 100% rename from Languages/en-us/index.php rename to Languages/en_US/index.php diff --git a/Sources/Actions/Admin/Languages.php b/Sources/Actions/Admin/Languages.php index 7a6813777f..265756080d 100644 --- a/Sources/Actions/Admin/Languages.php +++ b/Sources/Actions/Admin/Languages.php @@ -864,7 +864,7 @@ function ($val1, $val2) { // Sixth, if we deleted the default language, set us back to english? if ($lang_id == Lang::$default) { - Lang::$default = 'english'; + Lang::$default = 'en_US'; Config::updateSettingsFile(['language' => Lang::$default]); } @@ -1589,7 +1589,7 @@ public static function list_getLanguages(): array 'id' => $lang['filename'], 'count' => 0, 'char_set' => Lang::$txt['lang_character_set'], - 'default' => Lang::$default == $lang['filename'] || (Lang::$default == '' && $lang['filename'] == 'en-us'), + 'default' => Lang::$default == $lang['filename'] || (Lang::$default == '' && $lang['filename'] == 'en_US'), 'locale' => Lang::$txt['lang_locale'], 'name' => $lang['name'], ]; diff --git a/Sources/Actions/Admin/Themes.php b/Sources/Actions/Admin/Themes.php index ae95e540b1..d1e7713c14 100644 --- a/Sources/Actions/Admin/Themes.php +++ b/Sources/Actions/Admin/Themes.php @@ -1557,7 +1557,7 @@ protected function installCopy(): array '/css/rtl.css', '/scripts/theme.js', '/languages/index.php', - '/languages/en-us/ThemeStrings.php', + '/languages/en_US/ThemeStrings.php', ]; foreach ($to_copy as $file) { diff --git a/Sources/Actions/Agreement.php b/Sources/Actions/Agreement.php index f0a23295a1..3089e0d82a 100644 --- a/Sources/Actions/Agreement.php +++ b/Sources/Actions/Agreement.php @@ -179,8 +179,8 @@ protected function prepareAgreementContext(): void // Have we got a localized one? if (file_exists(Config::$languagesdir . '/' . User::$me->language . '/agreement.txt')) { Utils::$context['agreement_file'] = Config::$languagesdir . '/' . User::$me->language . '/agreement.txt'; - } elseif (file_exists(Config::$languagesdir . '/en-us/agreement.txt')) { - Utils::$context['agreement_file'] = Config::$languagesdir . '/en-us/agreement.txt'; + } elseif (file_exists(Config::$languagesdir . '/en_US/agreement.txt')) { + Utils::$context['agreement_file'] = Config::$languagesdir . '/en_US/agreement.txt'; } if (!empty(Utils::$context['agreement_file'])) { diff --git a/Sources/Lang.php b/Sources/Lang.php index f70f311c24..1ebd6e90f4 100644 --- a/Sources/Lang.php +++ b/Sources/Lang.php @@ -190,9 +190,9 @@ public static function load(string $template_name, string $lang = '', bool $fata } // Fall back to English if none of the preferred languages can be found. - if (empty(Config::$modSettings['disable_language_fallback']) && !in_array('en-us', [$lang, self::$default])) { + if (empty(Config::$modSettings['disable_language_fallback']) && !in_array('en_US', array($lang, self::$default))) { foreach (self::$dirs as $dir) { - $attempts[] = [$dir, $template, 'en-us']; + $attempts[] = array($dir, $template, 'en_US'); } } @@ -231,7 +231,7 @@ public static function load(string $template_name, string $lang = '', bool $fata if (isset($forum_copyright)) { self::$localized_copyright[$file[2]] = $forum_copyright; - self::$forum_copyright = self::$localized_copyright[$lang] ?? (self::$localized_copyright[self::$default] ?? (self::$localized_copyright['en-us'] ?? '')); + self::$forum_copyright = self::$localized_copyright[$lang] ?? (self::$localized_copyright[self::$default] ?? (self::$localized_copyright['en_US'] ?? '')); unset($forum_copyright); } @@ -405,7 +405,7 @@ public static function get(bool $use_cache = true): array // Set the language's name. if (!empty($matchNative) && !empty($matchNative[1])) { // Don't mislabel the language if the translator missed this one. - if ($entry !== 'en-us' && $matchNative[1] === 'English') { + if ($entry !== 'en_US' && $matchNative[1] === 'English') { break; } diff --git a/Sources/Theme.php b/Sources/Theme.php index ee558d1ca8..534e191cde 100644 --- a/Sources/Theme.php +++ b/Sources/Theme.php @@ -1313,7 +1313,7 @@ public static function template_header(): void // If agreement is enabled, at least the english version shall exist if (!empty(Config::$modSettings['requireAgreement'])) { - $agreement = !file_exists(Config::$languagesdir . '/en-us/agreement.txt'); + $agreement = !file_exists(Config::$languagesdir . '/en_US/agreement.txt'); } // If privacy policy is enabled, at least the default language version shall exist @@ -2625,7 +2625,6 @@ protected function loadTemplatesAndLangFiles(): void // Output is fully XML, so no need for the index template. if (isset($_REQUEST['xml']) && (in_array(Utils::$context['current_action'], $this->xmlActions) || $requiresXML)) { - { Lang::load('General+Modifications'); self::loadTemplate('Xml'); Utils::$context['template_layers'] = []; diff --git a/Sources/User.php b/Sources/User.php index f3719f7ebf..ede7f04ccd 100644 --- a/Sources/User.php +++ b/Sources/User.php @@ -5271,6 +5271,20 @@ protected function setLanguage(): void elseif (!empty($_SESSION['language']) && isset($languages[strtr($_SESSION['language'], './\\:', '____')])) { $this->language = strtr($_SESSION['language'], './\\:', '____'); } + // Can we locate it in the accept language? + elseif (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) + { + foreach (explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $match) + { + [$lang,] = explode(';', $match); + $lang = \Locale::canonicalize($lang); + + if (is_null($lang)) + continue; + elseif (isset($languages[$lang])) + $this->language = $_SESSION['language'] = $lang; + } + } } /************************* diff --git a/Themes/default/languages/en-us/ThemeStrings.php b/Themes/default/languages/en_US/ThemeStrings.php similarity index 100% rename from Themes/default/languages/en-us/ThemeStrings.php rename to Themes/default/languages/en_US/ThemeStrings.php diff --git a/Themes/default/languages/en-us/index.php b/Themes/default/languages/en_US/index.php similarity index 100% rename from Themes/default/languages/en-us/index.php rename to Themes/default/languages/en_US/index.php diff --git a/composer.lock b/composer.lock index 5520bf2207..8e00d570cf 100644 --- a/composer.lock +++ b/composer.lock @@ -173,12 +173,12 @@ "source": { "type": "git", "url": "https://github.com/SimpleMachines/BuildTools.git", - "reference": "21362ca18695da7e0c31260c62fa5e524b6c93bc" + "reference": "e12fe14153768005d8903dba95db909eee4ab839" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/SimpleMachines/BuildTools/zipball/21362ca18695da7e0c31260c62fa5e524b6c93bc", - "reference": "21362ca18695da7e0c31260c62fa5e524b6c93bc", + "url": "https://api.github.com/repos/SimpleMachines/BuildTools/zipball/e12fe14153768005d8903dba95db909eee4ab839", + "reference": "e12fe14153768005d8903dba95db909eee4ab839", "shasum": "" }, "require": { @@ -190,7 +190,7 @@ "source": "https://github.com/SimpleMachines/BuildTools/tree/master", "issues": "https://github.com/SimpleMachines/BuildTools/issues" }, - "time": "2023-11-11T16:22:30+00:00" + "time": "2023-11-11T18:56:12+00:00" }, { "name": "symfony/console", diff --git a/other/install.php b/other/install.php index 5da72ac7c2..ba6d55548c 100644 --- a/other/install.php +++ b/other/install.php @@ -354,7 +354,7 @@ function load_lang_file() if (!empty($matchNative) && !empty($matchNative[1])) { // Don't mislabel the language if the translator missed this one. - if ($entry !== 'en-us' && $matchNative[1] === 'English') + if ($entry !== 'en_US' && $matchNative[1] === 'English') break; $langName = Utils::htmlspecialcharsDecode($matchNative[1]); @@ -424,7 +424,7 @@ function load_lang_file() list($_SESSION['installer_temp_lang']) = array_keys($incontext['detected_languages']); // If we have english and some other language, use the other language. We Americans hate english :P. - if ($_SESSION['installer_temp_lang'] == 'Install.en-us.php' && count($incontext['detected_languages']) > 1) { + if ($_SESSION['installer_temp_lang'] == 'Install.en_US.php' && count($incontext['detected_languages']) > 1) { list (, $_SESSION['installer_temp_lang']) = array_keys($incontext['detected_languages']); } } diff --git a/other/upgrade.php b/other/upgrade.php index 214dc13e8f..212612d29f 100644 --- a/other/upgrade.php +++ b/other/upgrade.php @@ -547,7 +547,7 @@ function load_lang_file() } elseif (isset(Config::$language) && file_exists($lang_dir . '/' . Config::$language . '/Install.' . Config::$language . '.php')) { $_SESSION['upgrader_langfile'] = Config::$language . '/Install.' . Config::$language . '.php'; } else { - $_SESSION['upgrader_langfile'] = Config::$language . '/Install.en-us.php'; + $_SESSION['upgrader_langfile'] = Config::$language . '/Install.en_US.php'; } // Avoid pointless repetition @@ -563,12 +563,12 @@ function load_lang_file() $dir = dir($lang_dir); while ($entry = $dir->read()) { - if (!is_dir(Config::$languagesdir . '/' . $entry) || !file_exists(Config::$languagesdir . '/' . $entry . '/' . 'Install.' . $entry . '.php') || !file_exists(Config::$languagesdir . '/' . $entry . '/' . 'index.' . $entry . '.php')) { + if (!is_dir(Config::$languagesdir . '/' . $entry) || !file_exists(Config::$languagesdir . '/' . $entry . '/' . 'Install.php') || !file_exists(Config::$languagesdir . '/' . $entry . '/' . 'General.php')) { continue; } // Get the line we need. - $fp = @fopen($language_dir . '/' . $entry . '/' . 'index.' . $entry . '.php', 'r'); + $fp = @fopen($language_dir . '/' . $entry . '/' . 'index.php', 'r'); // Yay! if ($fp) { @@ -582,7 +582,7 @@ function load_lang_file() // Set the language's name. if (!empty($matchNative) && !empty($matchNative[1])) { // Don't mislabel the language if the translator missed this one. - if ($entry !== 'en-us' && $matchNative[1] === 'English') { + if ($entry !== 'en_US' && $matchNative[1] === 'English') { break; } @@ -686,7 +686,7 @@ function load_lang_file() list($_SESSION['upgrader_langfile']) = array_keys($detected_languages); // If we have English and some other language, use the other language. - if ($_SESSION['upgrader_langfile'] == 'Install.en-us.php' && count($detected_languages) > 1) { + if ($_SESSION['upgrader_langfile'] == 'Install.en_US.php' && count($detected_languages) > 1) { list (, $_SESSION['upgrader_langfile']) = array_keys($detected_languages); } } From 8f6ffd35e3a086cf010a9118b5cb93c645da147f Mon Sep 17 00:00:00 2001 From: jdarwood007 Date: Mon, 13 Nov 2023 17:42:53 -0800 Subject: [PATCH 11/35] We now require themes to always use ThemeStrings for any customizations --- Themes/default/index.template.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/Themes/default/index.template.php b/Themes/default/index.template.php index 9c798c75de..57c095d1fd 100644 --- a/Themes/default/index.template.php +++ b/Themes/default/index.template.php @@ -53,9 +53,6 @@ function template_init() // The version this template/theme is for. This should probably be the version of SMF it was created for. Theme::$current->settings['theme_version'] = '2.1'; - // Set the following variable to true if this theme requires the optional theme strings file to be loaded. - Theme::$current->settings['require_theme_strings'] = false; - // Set the following variable to true if this theme wants to display the avatar of the user that posted the last and the first post on the message index and recent pages. Theme::$current->settings['avatars_on_indexes'] = false; From bf3e4c9b9a5e361633e602c5f1bcec57ea92c5c0 Mon Sep 17 00:00:00 2001 From: jdarwood007 Date: Sat, 20 Jan 2024 08:09:33 -0800 Subject: [PATCH 12/35] Update composer --- composer.lock | 2280 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 2058 insertions(+), 222 deletions(-) diff --git a/composer.lock b/composer.lock index 8e00d570cf..0ac5407bff 100644 --- a/composer.lock +++ b/composer.lock @@ -4,30 +4,283 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "459367aef15bf2177bfed3beaacbe838", + "content-hash": "872641a4ede974af4756693d5f06b620", "packages": [], "packages-dev": [ { - "name": "n98/junit-xml", - "version": "1.1.0", + "name": "composer/pcre", + "version": "3.1.1", "source": { "type": "git", - "url": "https://github.com/cmuench/junit-xml.git", - "reference": "0017dd92ac8cb619f02e32f4cffd768cfe327c73" + "url": "https://github.com/composer/pcre.git", + "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cmuench/junit-xml/zipball/0017dd92ac8cb619f02e32f4cffd768cfe327c73", - "reference": "0017dd92ac8cb619f02e32f4cffd768cfe327c73", + "url": "https://api.github.com/repos/composer/pcre/zipball/00104306927c7a0919b4ced2aaa6782c1e61a3c9", + "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9", "shasum": "" }, + "require": { + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.1.1" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2023-10-11T07:11:09+00:00" + }, + { + "name": "composer/semver", + "version": "3.4.0", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.4", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2023-08-31T09:50:34+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "ced299686f41dce890debac69273b47ffe98a40c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", + "reference": "ced299686f41dce890debac69273b47ffe98a40c", + "shasum": "" + }, + "require": { + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, "require-dev": { - "phpunit/phpunit": "^9.5.0" + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^6.0" }, "type": "library", "autoload": { "psr-4": { - "N98\\JUnitXml\\": "src/N98/JUnitXml" + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-02-25T21:32:43+00:00" + }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v3.48.0", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "a92472c6fb66349de25211f31c77eceae3df024e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/a92472c6fb66349de25211f31c77eceae3df024e", + "reference": "a92472c6fb66349de25211f31c77eceae3df024e", + "shasum": "" + }, + "require": { + "composer/semver": "^3.4", + "composer/xdebug-handler": "^3.0.3", + "ext-filter": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0", + "sebastian/diff": "^4.0 || ^5.0", + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", + "symfony/finder": "^5.4 || ^6.0 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0", + "symfony/polyfill-mbstring": "^1.28", + "symfony/polyfill-php80": "^1.28", + "symfony/polyfill-php81": "^1.28", + "symfony/process": "^5.4 || ^6.0 || ^7.0", + "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" + }, + "require-dev": { + "facile-it/paraunit": "^1.3 || ^2.0", + "justinrainbow/json-schema": "^5.2", + "keradus/cli-executor": "^2.1", + "mikey179/vfsstream": "^1.6.11", + "php-coveralls/php-coveralls": "^2.7", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4", + "phpunit/phpunit": "^9.6 || ^10.5.5", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -36,44 +289,63 @@ ], "authors": [ { - "name": "Christian Münch", - "email": "c.muench@netz98.de" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" } ], - "description": "JUnit XML Document generation library", + "description": "A tool to automatically fix PHP code style", + "keywords": [ + "Static code analysis", + "fixer", + "standards", + "static analysis" + ], "support": { - "issues": "https://github.com/cmuench/junit-xml/issues", - "source": "https://github.com/cmuench/junit-xml/tree/1.1.0" + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.48.0" }, - "time": "2020-12-25T09:08:58+00:00" + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2024-01-19T21:44:39+00:00" }, { "name": "overtrue/phplint", - "version": "3.0.0", + "version": "9.0.4", "source": { "type": "git", "url": "https://github.com/overtrue/phplint.git", - "reference": "2d68ee8ab9083041a297cb6897ccec6290814c88" + "reference": "da8aa332372fbbf9aed174ed45ad190aed848b9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/overtrue/phplint/zipball/2d68ee8ab9083041a297cb6897ccec6290814c88", - "reference": "2d68ee8ab9083041a297cb6897ccec6290814c88", + "url": "https://api.github.com/repos/overtrue/phplint/zipball/da8aa332372fbbf9aed174ed45ad190aed848b9a", + "reference": "da8aa332372fbbf9aed174ed45ad190aed848b9a", "shasum": "" }, "require": { "ext-json": "*", - "n98/junit-xml": "1.1.0", - "php": ">=5.5.9", - "symfony/console": "^3.2|^4.0|^5.0", - "symfony/finder": "^3.0|^4.0|^5.0", - "symfony/process": "^3.3|^4.0|^5.0", - "symfony/yaml": "^3.0|^4.0|^5.0" + "php": "^8.0", + "symfony/cache": "^5.4 || ^6.0", + "symfony/console": "^5.4 || ^6.0", + "symfony/event-dispatcher": "^5.4 || ^6.0", + "symfony/finder": "^5.4 || ^6.0", + "symfony/options-resolver": "^5.4 || ^6.0", + "symfony/process": "^5.4 || ^6.0", + "symfony/yaml": "^5.4 || ^6.0" }, "require-dev": { - "brainmaestro/composer-git-hooks": "^2.7", - "friendsofphp/php-cs-fixer": "^2.16", - "jakub-onderka/php-console-highlighter": "^0.3.2 || ^0.4" + "bamarni/composer-bin-plugin": "^1.4", + "brainmaestro/composer-git-hooks": "^2.8.5 || 3.0.0-alpha.1", + "jetbrains/phpstorm-stubs": "^2021.3 || ^2022.3", + "php-parallel-lint/php-console-highlighter": "^1.0" }, "bin": [ "bin/phplint" @@ -83,10 +355,10 @@ "hooks": { "pre-commit": [ "composer fix-style" - ], - "pre-push": [ - "composer check-style" ] + }, + "branch-alias": { + "dev-main": "9.0.x-dev" } }, "autoload": { @@ -100,50 +372,1553 @@ ], "authors": [ { - "name": "overtrue", - "email": "anzhengchao@gmail.com" + "name": "overtrue", + "email": "anzhengchao@gmail.com" + }, + { + "name": "Laurent Laville", + "homepage": "https://github.com/llaville" + } + ], + "description": "`phplint` is a tool that can speed up linting of php files by running several lint processes at once.", + "keywords": [ + "check", + "lint", + "phplint", + "syntax" + ], + "support": { + "issues": "https://github.com/overtrue/phplint/issues", + "source": "https://github.com/overtrue/phplint/tree/9.0.4" + }, + "funding": [ + { + "url": "https://github.com/overtrue", + "type": "github" + } + ], + "time": "2023-02-23T15:46:09+00:00" + }, + { + "name": "psr/cache", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "213f9dbc5b9bfbc4f8db86d2838dc968752ce13b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/213f9dbc5b9bfbc4f8db86d2838dc968752ce13b", + "reference": "213f9dbc5b9bfbc4f8db86d2838dc968752ce13b", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/2.0.0" + }, + "time": "2021-02-03T23:23:37+00:00" + }, + { + "name": "psr/container", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.2" + }, + "time": "2021-11-05T16:50:12+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/log", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/ef29f6d262798707a9edd554e2b82517ef3a9376", + "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/2.0.0" + }, + "time": "2021-07-14T16:41:46+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-05-07T05:35:17+00:00" + }, + { + "name": "simplemachines/build-tools", + "version": "dev-release-3.0", + "source": { + "type": "git", + "url": "https://github.com/SimpleMachines/BuildTools.git", + "reference": "09ee356ced8c086af7d264db918459f39513769e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/SimpleMachines/BuildTools/zipball/09ee356ced8c086af7d264db918459f39513769e", + "reference": "09ee356ced8c086af7d264db918459f39513769e", + "shasum": "" + }, + "require": { + "overtrue/phplint": "9.0.4", + "php": ">=8.0" + }, + "default-branch": true, + "type": "library", + "support": { + "source": "https://github.com/SimpleMachines/BuildTools/tree/release-3.0", + "issues": "https://github.com/SimpleMachines/BuildTools/issues" + }, + "time": "2023-12-24T13:03:30+00:00" + }, + { + "name": "symfony/cache", + "version": "v5.4.34", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache.git", + "reference": "b17f28169f7a2f2c0cddf2b044d729f5b75efe5a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache/zipball/b17f28169f7a2f2c0cddf2b044d729f5b75efe5a", + "reference": "b17f28169f7a2f2c0cddf2b044d729f5b75efe5a", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/cache": "^1.0|^2.0", + "psr/log": "^1.1|^2|^3", + "symfony/cache-contracts": "^1.1.7|^2", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/var-exporter": "^4.4|^5.0|^6.0" + }, + "conflict": { + "doctrine/dbal": "<2.13.1", + "symfony/dependency-injection": "<4.4", + "symfony/http-kernel": "<4.4", + "symfony/var-dumper": "<4.4" + }, + "provide": { + "psr/cache-implementation": "1.0|2.0", + "psr/simple-cache-implementation": "1.0|2.0", + "symfony/cache-implementation": "1.0|2.0" + }, + "require-dev": { + "cache/integration-tests": "dev-master", + "doctrine/cache": "^1.6|^2.0", + "doctrine/dbal": "^2.13.1|^3|^4", + "predis/predis": "^1.1", + "psr/simple-cache": "^1.0|^2.0", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/filesystem": "^4.4|^5.0|^6.0", + "symfony/http-kernel": "^4.4|^5.0|^6.0", + "symfony/messenger": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Cache\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides extended PSR-6, PSR-16 (and tags) implementations", + "homepage": "https://symfony.com", + "keywords": [ + "caching", + "psr6" + ], + "support": { + "source": "https://github.com/symfony/cache/tree/v5.4.34" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-12-18T14:56:06+00:00" + }, + { + "name": "symfony/cache-contracts", + "version": "v2.5.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache-contracts.git", + "reference": "64be4a7acb83b6f2bf6de9a02cee6dad41277ebc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/64be4a7acb83b6f2bf6de9a02cee6dad41277ebc", + "reference": "64be4a7acb83b6f2bf6de9a02cee6dad41277ebc", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/cache": "^1.0|^2.0|^3.0" + }, + "suggest": { + "symfony/cache-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Cache\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to caching", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/cache-contracts/tree/v2.5.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:53:40+00:00" + }, + { + "name": "symfony/console", + "version": "v5.4.34", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "4b4d8cd118484aa604ec519062113dd87abde18c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/4b4d8cd118484aa604ec519062113dd87abde18c", + "reference": "4b4d8cd118484aa604ec519062113dd87abde18c", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.1|^6.0" + }, + "conflict": { + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0" + }, + "require-dev": { + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v5.4.34" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-12-08T13:33:03+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.5.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:53:40+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v5.4.34", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "e3bca343efeb613f843c254e7718ef17c9bdf7a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/e3bca343efeb613f843c254e7718ef17c9bdf7a3", + "reference": "e3bca343efeb613f843c254e7718ef17c9bdf7a3", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/event-dispatcher-contracts": "^2|^3", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "symfony/dependency-injection": "<4.4" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/http-foundation": "^4.4|^5.0|^6.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/stopwatch": "^4.4|^5.0|^6.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.34" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-12-27T21:12:56+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v2.5.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/f98b54df6ad059855739db6fcbc2d36995283fe1", + "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/event-dispatcher": "^1" + }, + "suggest": { + "symfony/event-dispatcher-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:53:40+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v5.4.25", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "0ce3a62c9579a53358d3a7eb6b3dfb79789a6364" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/0ce3a62c9579a53358d3a7eb6b3dfb79789a6364", + "reference": "0ce3a62c9579a53358d3a7eb6b3dfb79789a6364", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v5.4.25" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-05-31T13:04:02+00:00" + }, + { + "name": "symfony/finder", + "version": "v5.4.27", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "ff4bce3c33451e7ec778070e45bd23f74214cd5d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/ff4bce3c33451e7ec778070e45bd23f74214cd5d", + "reference": "ff4bce3c33451e7ec778070e45bd23f74214cd5d", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v5.4.27" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-07-31T08:02:31+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v5.4.21", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9", + "reference": "4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php73": "~1.0", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v5.4.21" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-02-14T08:03:56+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.28.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-26T09:26:14+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.28.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "875e90aeea2777b6f135677f618529449334a612" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", + "reference": "875e90aeea2777b6f135677f618529449334a612", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-26T09:26:14+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.28.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-26T09:26:14+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.28.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "42292d99c55abe617799667f454222c54c60e229" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", + "reference": "42292d99c55abe617799667f454222c54c60e229", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-07-28T09:04:16+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.28.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fe2f306d1d9d346a7fee353d0d5012e401e984b5", + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.28.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-26T09:26:14+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.28.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "`phplint` is a tool that can speed up linting of php files by running several lint processes at once.", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", "keywords": [ - "check", - "lint", - "phplint", - "syntax" + "compatibility", + "polyfill", + "portable", + "shim" ], "support": { - "issues": "https://github.com/overtrue/phplint/issues", - "source": "https://github.com/overtrue/phplint/tree/3.0.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" }, - "time": "2021-06-02T13:27:41+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-26T09:26:14+00:00" }, { - "name": "psr/log", - "version": "1.1.4", + "name": "symfony/polyfill-php81", + "version": "v1.28.0", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -151,93 +1926,63 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", "keywords": [ - "log", - "psr", - "psr-3" + "compatibility", + "polyfill", + "portable", + "shim" ], "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" - }, - "time": "2021-05-03T11:20:27+00:00" - }, - { - "name": "simplemachines/build-tools", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/SimpleMachines/BuildTools.git", - "reference": "e12fe14153768005d8903dba95db909eee4ab839" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/SimpleMachines/BuildTools/zipball/e12fe14153768005d8903dba95db909eee4ab839", - "reference": "e12fe14153768005d8903dba95db909eee4ab839", - "shasum": "" - }, - "require": { - "overtrue/phplint": "3.0" - }, - "default-branch": true, - "type": "library", - "support": { - "source": "https://github.com/SimpleMachines/BuildTools/tree/master", - "issues": "https://github.com/SimpleMachines/BuildTools/issues" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0" }, - "time": "2023-11-11T18:56:12+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-26T09:26:14+00:00" }, { - "name": "symfony/console", - "version": "v3.3.6", + "name": "symfony/process", + "version": "v5.4.34", "source": { "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "b0878233cb5c4391347e5495089c7af11b8e6201" + "url": "https://github.com/symfony/process.git", + "reference": "8fa22178dfc368911dbd513b431cd9b06f9afe7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/b0878233cb5c4391347e5495089c7af11b8e6201", - "reference": "b0878233cb5c4391347e5495089c7af11b8e6201", + "url": "https://api.github.com/repos/symfony/process/zipball/8fa22178dfc368911dbd513b431cd9b06f9afe7a", + "reference": "8fa22178dfc368911dbd513b431cd9b06f9afe7a", "shasum": "" }, "require": { - "php": ">=5.5.9", - "symfony/debug": "~2.8|~3.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/dependency-injection": "<3.3" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~3.3", - "symfony/dependency-injection": "~3.3", - "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/filesystem": "~2.8|~3.0", - "symfony/http-kernel": "~2.8|~3.0", - "symfony/process": "~2.8|~3.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/filesystem": "", - "symfony/process": "" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, "autoload": { "psr-4": { - "Symfony\\Component\\Console\\": "" + "Symfony\\Component\\Process\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -257,50 +2002,66 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Console Component", + "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/console/tree/3.3" + "source": "https://github.com/symfony/process/tree/v5.4.34" }, - "time": "2017-07-29T21:27:59+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-12-02T08:41:43+00:00" }, { - "name": "symfony/debug", - "version": "v3.3.6", + "name": "symfony/service-contracts", + "version": "v2.5.2", "source": { "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "7c13ae8ce1e2adbbd574fc39de7be498e1284e13" + "url": "https://github.com/symfony/service-contracts.git", + "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/7c13ae8ce1e2adbbd574fc39de7be498e1284e13", - "reference": "7c13ae8ce1e2adbbd574fc39de7be498e1284e13", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c", + "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c", "shasum": "" }, "require": { - "php": ">=5.5.9", - "psr/log": "~1.0" + "php": ">=7.2.5", + "psr/container": "^1.1", + "symfony/deprecation-contracts": "^2.1|^3" }, "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + "ext-psr": "<1.1|>=2" }, - "require-dev": { - "symfony/http-kernel": "~2.8|~3.0" + "suggest": { + "symfony/service-implementation": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Debug\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Symfony\\Contracts\\Service\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -308,48 +2069,65 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Debug Component", + "description": "Generic abstractions related to writing services", "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], "support": { - "source": "https://github.com/symfony/debug/tree/3.3" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.2" }, - "abandoned": "symfony/error-handler", - "time": "2017-07-28T15:27:31+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-05-30T19:17:29+00:00" }, { - "name": "symfony/finder", - "version": "v3.3.6", + "name": "symfony/stopwatch", + "version": "v5.4.21", "source": { "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "baea7f66d30854ad32988c11a09d7ffd485810c4" + "url": "https://github.com/symfony/stopwatch.git", + "reference": "f83692cd869a6f2391691d40a01e8acb89e76fee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/baea7f66d30854ad32988c11a09d7ffd485810c4", - "reference": "baea7f66d30854ad32988c11a09d7ffd485810c4", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/f83692cd869a6f2391691d40a01e8acb89e76fee", + "reference": "f83692cd869a6f2391691d40a01e8acb89e76fee", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": ">=7.2.5", + "symfony/service-contracts": "^1|^2|^3" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, "autoload": { "psr-4": { - "Symfony\\Component\\Finder\\": "" + "Symfony\\Component\\Stopwatch\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -369,50 +2147,69 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Finder Component", + "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/3.3" + "source": "https://github.com/symfony/stopwatch/tree/v5.4.21" }, - "time": "2017-06-01T21:01:25+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-02-14T08:03:56+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.19.0", + "name": "symfony/string", + "version": "v5.4.34", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "b5f7b932ee6fa802fc792eabd77c4c88084517ce" + "url": "https://github.com/symfony/string.git", + "reference": "e3f98bfc7885c957488f443df82d97814a3ce061" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b5f7b932ee6fa802fc792eabd77c4c88084517ce", - "reference": "b5f7b932ee6fa802fc792eabd77c4c88084517ce", + "url": "https://api.github.com/repos/symfony/string/zipball/e3f98bfc7885c957488f443df82d97814a3ce061", + "reference": "e3f98bfc7885c957488f443df82d97814a3ce061", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" }, - "suggest": { - "ext-mbstring": "For best performance" + "conflict": { + "symfony/translation-contracts": ">=3.0" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.19-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } + "require-dev": { + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/http-client": "^4.4|^5.0|^6.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0|^6.0" }, + "type": "library", "autoload": { "files": [ - "bootstrap.php" + "Resources/functions.php" ], "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - } + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -428,17 +2225,18 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for the Mbstring extension", + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", "homepage": "https://symfony.com", "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.19.0" + "source": "https://github.com/symfony/string/tree/v5.4.34" }, "funding": [ { @@ -454,34 +2252,33 @@ "type": "tidelift" } ], - "time": "2020-10-23T09:01:57+00:00" + "time": "2023-12-09T13:20:28+00:00" }, { - "name": "symfony/process", - "version": "v3.3.6", + "name": "symfony/var-exporter", + "version": "v5.4.32", "source": { "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "07432804942b9f6dd7b7377faf9920af5f95d70a" + "url": "https://github.com/symfony/var-exporter.git", + "reference": "fdb022f0d3d41df240c18e2eb9a117c430f06add" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/07432804942b9f6dd7b7377faf9920af5f95d70a", - "reference": "07432804942b9f6dd7b7377faf9920af5f95d70a", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/fdb022f0d3d41df240c18e2eb9a117c430f06add", + "reference": "fdb022f0d3d41df240c18e2eb9a117c430f06add", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } + "require-dev": { + "symfony/var-dumper": "^4.4.9|^5.0.9|^6.0" }, + "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\Process\\": "" + "Symfony\\Component\\VarExporter\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -493,50 +2290,75 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Process Component", + "description": "Allows exporting any serializable PHP data structure to plain PHP code", "homepage": "https://symfony.com", + "keywords": [ + "clone", + "construct", + "export", + "hydrate", + "instantiate", + "serialize" + ], "support": { - "source": "https://github.com/symfony/process/tree/3.3" + "source": "https://github.com/symfony/var-exporter/tree/v5.4.32" }, - "time": "2017-07-13T13:05:09+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-11-16T19:33:05+00:00" }, { "name": "symfony/yaml", - "version": "v3.3.6", + "version": "v5.4.31", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "ddc23324e6cfe066f3dd34a37ff494fa80b617ed" + "reference": "f387675d7f5fc4231f7554baa70681f222f73563" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/ddc23324e6cfe066f3dd34a37ff494fa80b617ed", - "reference": "ddc23324e6cfe066f3dd34a37ff494fa80b617ed", + "url": "https://api.github.com/repos/symfony/yaml/zipball/f387675d7f5fc4231f7554baa70681f222f73563", + "reference": "f387675d7f5fc4231f7554baa70681f222f73563", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "symfony/console": "<5.3" }, "require-dev": { - "symfony/console": "~2.8|~3.0" + "symfony/console": "^5.3|^6.0" }, "suggest": { "symfony/console": "For validating YAML files using the lint command" }, + "bin": [ + "Resources/bin/yaml-lint" + ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Yaml\\": "" @@ -559,12 +2381,26 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Yaml Component", + "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/3.3" + "source": "https://github.com/symfony/yaml/tree/v5.4.31" }, - "time": "2017-07-23T12:43:26+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-11-03T14:41:28+00:00" } ], "aliases": [], @@ -577,7 +2413,7 @@ "platform": [], "platform-dev": [], "platform-overrides": { - "php": "7.0.2" + "php": "8.0.0" }, "plugin-api-version": "2.6.0" } From 8abd50503b8bdeb41b0f272b36e2a622d173e8d2 Mon Sep 17 00:00:00 2001 From: jdarwood007 Date: Sat, 20 Jan 2024 08:11:24 -0800 Subject: [PATCH 13/35] Index updates --- Languages/en_US/index.php | 4 ++-- Languages/index.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Languages/en_US/index.php b/Languages/en_US/index.php index 2cf5d33d8a..976d292448 100644 --- a/Languages/en_US/index.php +++ b/Languages/en_US/index.php @@ -1,8 +1,8 @@ Date: Sat, 20 Jan 2024 08:27:20 -0800 Subject: [PATCH 14/35] One more time --- Themes/default/languages/en_US/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Themes/default/languages/en_US/index.php b/Themes/default/languages/en_US/index.php index 2cf5d33d8a..976d292448 100644 --- a/Themes/default/languages/en_US/index.php +++ b/Themes/default/languages/en_US/index.php @@ -1,8 +1,8 @@ Date: Sun, 21 Jan 2024 18:14:02 -0800 Subject: [PATCH 15/35] Apply php-cs-fixer --- Languages/en_US/Admin.php | 1 + Languages/en_US/Agreement.php | 1 + Languages/en_US/Alerts.php | 1 + Languages/en_US/Drafts.php | 1 + Languages/en_US/Editor.php | 1 + Languages/en_US/EmailTemplates.php | 121 ++++++++++++----------- Languages/en_US/Errors.php | 1 + Languages/en_US/General.php | 11 ++- Languages/en_US/Help.php | 1 + Languages/en_US/Install.php | 1 + Languages/en_US/Login.php | 1 + Languages/en_US/ManageBoards.php | 1 + Languages/en_US/ManageCalendar.php | 1 + Languages/en_US/ManageMail.php | 1 + Languages/en_US/ManageMaintenance.php | 1 + Languages/en_US/ManageMembers.php | 1 + Languages/en_US/ManagePaid.php | 1 + Languages/en_US/ManagePermissions.php | 1 + Languages/en_US/ManageScheduledTasks.php | 1 + Languages/en_US/ManageSettings.php | 1 + Languages/en_US/ManageSmileys.php | 1 + Languages/en_US/Manual.php | 1 + Languages/en_US/ModerationCenter.php | 1 + Languages/en_US/Modifications.php | 1 + Languages/en_US/Modlog.php | 1 + Languages/en_US/Packages.php | 1 + Languages/en_US/PersonalMessage.php | 1 + Languages/en_US/Post.php | 1 + Languages/en_US/Profile.php | 3 +- Languages/en_US/Reports.php | 1 + Languages/en_US/Search.php | 1 + Languages/en_US/Stats.php | 1 + Languages/en_US/Themes.php | 1 + Languages/en_US/Timezones.php | 1 + Languages/en_US/Who.php | 1 + Sources/Actions/Admin/Languages.php | 7 +- Sources/Actions/Admin/Themes.php | 18 ++-- Sources/Actions/Agreement.php | 2 +- Sources/Config.php | 7 +- Sources/Lang.php | 8 +- Sources/User.php | 17 ++-- 41 files changed, 130 insertions(+), 96 deletions(-) diff --git a/Languages/en_US/Admin.php b/Languages/en_US/Admin.php index a7c9391a8e..ed928f2c60 100644 --- a/Languages/en_US/Admin.php +++ b/Languages/en_US/Admin.php @@ -1,4 +1,5 @@ 'January'. (or translated, of course.) $txt['months_title'] = 'Months'; -$txt['months'] = array(1 => 'January', 2 => 'February', 3 => 'March', 4 => 'April', 5 => 'May', 6 => 'June', 7 => 'July', 8 => 'August', 9 => 'September', 10 => 'October', 11 => 'November', 12 => 'December'); -$txt['months_titles'] = array(1 => 'January', 2 => 'February', 3 => 'March', 4 => 'April', 5 => 'May', 6 => 'June', 7 => 'July', 8 => 'August', 9 => 'September', 10 => 'October', 11 => 'November', 12 => 'December'); -$txt['months_short'] = array(1 => 'Jan', 2 => 'Feb', 3 => 'Mar', 4 => 'Apr', 5 => 'May', 6 => 'Jun', 7 => 'Jul', 8 => 'Aug', 9 => 'Sep', 10 => 'Oct', 11 => 'Nov', 12 => 'Dec'); +$txt['months'] = [1 => 'January', 2 => 'February', 3 => 'March', 4 => 'April', 5 => 'May', 6 => 'June', 7 => 'July', 8 => 'August', 9 => 'September', 10 => 'October', 11 => 'November', 12 => 'December']; +$txt['months_titles'] = [1 => 'January', 2 => 'February', 3 => 'March', 4 => 'April', 5 => 'May', 6 => 'June', 7 => 'July', 8 => 'August', 9 => 'September', 10 => 'October', 11 => 'November', 12 => 'December']; +$txt['months_short'] = [1 => 'Jan', 2 => 'Feb', 3 => 'Mar', 4 => 'Apr', 5 => 'May', 6 => 'Jun', 7 => 'Jul', 8 => 'Aug', 9 => 'Sep', 10 => 'Oct', 11 => 'Nov', 12 => 'Dec']; $txt['prev_month'] = 'Previous month'; $txt['next_month'] = 'Next month'; $txt['start'] = 'Start'; diff --git a/Languages/en_US/Help.php b/Languages/en_US/Help.php index 413f64647d..fee696b75b 100644 --- a/Languages/en_US/Help.php +++ b/Languages/en_US/Help.php @@ -1,4 +1,5 @@ \ No newline at end of file diff --git a/Languages/en_US/Modlog.php b/Languages/en_US/Modlog.php index 5a4a87c22f..44a634911f 100644 --- a/Languages/en_US/Modlog.php +++ b/Languages/en_US/Modlog.php @@ -1,4 +1,5 @@ Please note:
    %1$s
'; -$txt['export_profile_data_desc_list'] = array('It may take some time for the system to finish compiling your data.', 'A download link will appear on this page once the export process is complete.', 'expiry' => 'Old export files are deleted after %1$d days.'); +$txt['export_profile_data_desc_list'] = ['It may take some time for the system to finish compiling your data.', 'A download link will appear on this page once the export process is complete.', 'expiry' => 'Old export files are deleted after %1$d days.']; $txt['active_exports'] = 'Exports currently in progress'; $txt['completed_exports'] = 'Completed exports'; $txt['export_outdated_warning'] = 'This export is out of date. It is missing your most recent data of the following types:'; diff --git a/Languages/en_US/Reports.php b/Languages/en_US/Reports.php index bac654a088..dd632fd7b0 100644 --- a/Languages/en_US/Reports.php +++ b/Languages/en_US/Reports.php @@ -1,4 +1,5 @@ 0, 'name' => Lang::$txt['languages_default'], 'files' => [], - ] + ], ]; foreach ($lang_dirs as $theme => $theme_dir) { - if (!is_dir($theme_dir . '/' . $lang_id)) + if (!is_dir($theme_dir . '/' . $lang_id)) { continue; + } // Open it up. $dir = dir($theme_dir . '/' . $lang_id); diff --git a/Sources/Actions/Admin/Themes.php b/Sources/Actions/Admin/Themes.php index d1e7713c14..75e3fc038b 100644 --- a/Sources/Actions/Admin/Themes.php +++ b/Sources/Actions/Admin/Themes.php @@ -1256,15 +1256,14 @@ public function copy(): void } if (is_dir(Theme::$current->settings['default_theme_dir'] . '/languages')) { - foreach (new \DirectoryIterator(Theme::$current->settings['default_theme_dir'] . '/languages') as $langDir) - { - if (!is_dir($langDir->getPathname()) || $langDir->getFilename()[0] == '.') + foreach (new \DirectoryIterator(Theme::$current->settings['default_theme_dir'] . '/languages') as $langDir) { + if (!is_dir($langDir->getPathname()) || $langDir->getFilename()[0] == '.') { continue; + } $lang_files[$langDir->getFilename()] = []; - foreach (new \DirectoryIterator($langDir->getPathname()) as $fileInfo) - { + foreach (new \DirectoryIterator($langDir->getPathname()) as $fileInfo) { if ($fileInfo->getExtension() == 'php') { $lang_files[$langDir->getFilename()][] = $fileInfo->getFilename(); } @@ -1308,10 +1307,8 @@ public function copy(): void } } - if (is_dir($theme['theme_dir'] . '/languages')) - { - foreach (new \DirectoryIterator($theme['theme_dir'] . '/languages') as $langDir) - { + if (is_dir($theme['theme_dir'] . '/languages')) { + foreach (new \DirectoryIterator($theme['theme_dir'] . '/languages') as $langDir) { if (!is_dir($langDir->getPathname()) || $langDir->getFilename()[0] == '.') { continue; } @@ -1319,8 +1316,7 @@ public function copy(): void $lang_files[$langDir->getFilename()] = []; foreach (new \DirectoryIterator($langDir->getPathname()) as $fileInfo) { - if ($fileInfo->getExtension() == 'php' && isset(Utils::$context['available_language_files'][$langDir->getFilename() . '/' . $fileInfo->getFilename()])) - { + if ($fileInfo->getExtension() == 'php' && isset(Utils::$context['available_language_files'][$langDir->getFilename() . '/' . $fileInfo->getFilename()])) { Utils::$context['available_language_files'][$langDir->getFilename() . '/' . $fileInfo->getFilename()]['already_exists'] = true; Utils::$context['available_language_files'][$langDir->getFilename() . '/' . $fileInfo->getFilename()]['can_copy'] = is_writable($theme['theme_dir'] . '/languages/' . $entry); } diff --git a/Sources/Actions/Agreement.php b/Sources/Actions/Agreement.php index 3089e0d82a..ae7eee90a2 100644 --- a/Sources/Actions/Agreement.php +++ b/Sources/Actions/Agreement.php @@ -184,7 +184,7 @@ protected function prepareAgreementContext(): void } if (!empty(Utils::$context['agreement_file'])) { - $cache_id = strtr(Utils::$context['agreement_file'], array(Config::$languagesdir => '', '.txt' => '', '.' => '_')); + $cache_id = strtr(Utils::$context['agreement_file'], [Config::$languagesdir => '', '.txt' => '', '.' => '_']); Utils::$context['agreement'] = BBCodeParser::load()->parse(file_get_contents(Utils::$context['agreement_file']), true, $cache_id); } elseif (Utils::$context['can_accept_agreement']) { ErrorHandler::fatalLang('error_no_agreement', false); diff --git a/Sources/Config.php b/Sources/Config.php index a0e0424050..b323d78d40 100644 --- a/Sources/Config.php +++ b/Sources/Config.php @@ -806,7 +806,7 @@ class Config if (!is_dir(realpath($languagesdir)) && is_dir($boarddir . '/Languages')) $languagesdir = $boarddir . '/Languages'; END, - 'search_pattern' => '~\n?(#[^\n]+)?(?:\n\h*if\s*\((?:\!file_exists\(\$(?'.'>boarddir|sourcedir|tasksdir|packagesdir|cachedir|languagesdir)\)|\!is_dir\(realpath\(\$(?'.'>boarddir|sourcedir|tasksdir|packagesdir|cachedir|languagesdir)\)\))[^;]+\n\h*\$(?'.'>boarddir|sourcedir|tasksdir|packagesdir|cachedir|languagesdir)[^\n]+;)+~sm', + 'search_pattern' => '~\n?(#[^\n]+)?(?:\n\h*if\s*\((?:\!file_exists\(\$(?' . '>boarddir|sourcedir|tasksdir|packagesdir|cachedir|languagesdir)\)|\!is_dir\(realpath\(\$(?' . '>boarddir|sourcedir|tasksdir|packagesdir|cachedir|languagesdir)\)\))[^;]+\n\h*\$(?' . '>boarddir|sourcedir|tasksdir|packagesdir|cachedir|languagesdir)[^\n]+;)+~sm', ], 'db_character_set' => [ 'text' => <<<'END' @@ -952,7 +952,7 @@ public static function set(array $settings): void // Ensure there are no trailing slashes in these settings. foreach (['boardurl', 'boarddir', 'sourcedir', 'packagesdir', 'tasksdir', 'cachedir', 'languagesdir'] as $var) { if (!is_null(self::${$var})) { - self::${$var} = rtrim(self::${$var}, "\\/"); + self::${$var} = rtrim(self::${$var}, '\\/'); } } @@ -974,8 +974,7 @@ public static function set(array $settings): void self::$packagesdir = self::$boarddir . '/Packages'; } - if ((empty(self::$languagesdir) || !is_dir(realpath(self::$languagesdir))) && is_dir(self::$boarddir . '/Languages')) - { + if ((empty(self::$languagesdir) || !is_dir(realpath(self::$languagesdir))) && is_dir(self::$boarddir . '/Languages')) { self::$languagesdir = self::$boarddir . '/Languages'; } diff --git a/Sources/Lang.php b/Sources/Lang.php index 1ebd6e90f4..002d6e3a8c 100644 --- a/Sources/Lang.php +++ b/Sources/Lang.php @@ -190,9 +190,9 @@ public static function load(string $template_name, string $lang = '', bool $fata } // Fall back to English if none of the preferred languages can be found. - if (empty(Config::$modSettings['disable_language_fallback']) && !in_array('en_US', array($lang, self::$default))) { + if (empty(Config::$modSettings['disable_language_fallback']) && !in_array('en_US', [$lang, self::$default])) { foreach (self::$dirs as $dir) { - $attempts[] = array($dir, $template, 'en_US'); + $attempts[] = [$dir, $template, 'en_US']; } } @@ -260,9 +260,11 @@ public static function load(string $template_name, string $lang = '', bool $fata ErrorHandler::log(sprintf(self::$txt['theme_language_error'] ?? 'Unable to load the \'%1$s\' language file.', $template_name . '.' . $lang, 'template')); break; } + // Keep track of what we're up to, soldier. - elseif (!empty(Config::$db_show_debug)) + if (!empty(Config::$db_show_debug)) { Utils::$context['debug']['language_files'][] = $file[2] . '.' . $file[1] . ' (' . (Config::$languagesdir == $file[0] ? 'Base' : basename(Theme::$current->settings['theme_url'] ?? 'unknown')) . ')'; + } // Copyright can't be empty. if (empty(self::$forum_copyright)) { diff --git a/Sources/User.php b/Sources/User.php index ede7f04ccd..2c7bb6cf84 100644 --- a/Sources/User.php +++ b/Sources/User.php @@ -5272,17 +5272,18 @@ protected function setLanguage(): void $this->language = strtr($_SESSION['language'], './\\:', '____'); } // Can we locate it in the accept language? - elseif (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) - { - foreach (explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $match) - { - [$lang,] = explode(';', $match); + elseif (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { + foreach (explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $match) { + [$lang] = explode(';', $match); $lang = \Locale::canonicalize($lang); - - if (is_null($lang)) + + if (is_null($lang)) { continue; - elseif (isset($languages[$lang])) + } + + if (isset($languages[$lang])) { $this->language = $_SESSION['language'] = $lang; + } } } } From 5858a32adbd1977296840e2cd545cf3a1ed6cb7a Mon Sep 17 00:00:00 2001 From: jdarwood007 Date: Wed, 24 Jan 2024 16:48:39 -0800 Subject: [PATCH 16/35] Minor fixes --- .gitignore | 2 +- Sources/Actions/Admin/Languages.php | 14 +++++++------- other/upgrade.php | 22 +++++++++++----------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 3d528ac5ee..3d5e05882e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # SMF Generated Files # ####################### -/Languages/en-us/agreement.txt +/Languages/en_US/agreement.txt Settings.php Settings_bak.php Settings_org.php diff --git a/Sources/Actions/Admin/Languages.php b/Sources/Actions/Admin/Languages.php index 9e6c9261d9..b0efa7ded9 100644 --- a/Sources/Actions/Admin/Languages.php +++ b/Sources/Actions/Admin/Languages.php @@ -884,14 +884,14 @@ function ($val1, $val2) { ]; $madeSave = false; - $index_filename = Config::$languagesdir . '/' . $lang_id . '/' . 'index.' . $lang_id . '.php'; + $general_filename = Config::$languagesdir . '/' . $lang_id . '/General.php'; if (!empty($_POST['save_main']) && !$current_file) { User::$me->checkSession(); SecurityToken::validate('admin-mlang'); // Read in the current file. - $current_data = implode('', file($index_filename)); + $current_data = implode('', file($general_filename)); // Build the replacements. old => new $replace_array = []; @@ -902,19 +902,19 @@ function ($val1, $val2) { $current_data = preg_replace(array_keys($replace_array), array_values($replace_array), $current_data); - $fp = fopen($index_filename, 'w+'); + $fp = fopen($general_filename, 'w+'); fwrite($fp, $current_data); fclose($fp); $madeSave = true; } - // Quickly load index language entries. + // Quickly load General language entries. $old_txt = Lang::$txt; - require $index_filename; + require $general_filename; - Utils::$context['lang_file_not_writable_message'] = is_writable($index_filename) ? '' : sprintf(Lang::$txt['lang_file_not_writable'], $index_filename); + Utils::$context['lang_file_not_writable_message'] = is_writable($general_filename) ? '' : sprintf(Lang::$txt['lang_file_not_writable'], $general_filename); // Setup the primary settings context. Utils::$context['primary_settings']['name'] = Utils::ucwords(strtr($lang_id, ['_' => ' ', '-utf8' => ''])); @@ -1552,7 +1552,7 @@ public static function list_getNumLanguages(): int /** * Fetch the actual language information. * Callback for $listOptions['get_items']['function'] in editLanguages. - * Determines which languages are available by looking for the "index.{language}.php" file. + * Determines which languages are available by looking for the "{language}/General.php" file. * Also figures out how many users are using a particular language. * * @return array An array of information about currently installed languages diff --git a/other/upgrade.php b/other/upgrade.php index 212612d29f..f61c3e6c64 100644 --- a/other/upgrade.php +++ b/other/upgrade.php @@ -568,7 +568,7 @@ function load_lang_file() } // Get the line we need. - $fp = @fopen($language_dir . '/' . $entry . '/' . 'index.php', 'r'); + $fp = @fopen(Config::$languagesdir . '/' . $entry . '/' . 'index.php', 'r'); // Yay! if ($fp) { @@ -599,7 +599,7 @@ function load_lang_file() $dir->close(); } // Our guess was wrong, but that's fine. We'll try again after Config::$Languagesdir is defined. - elseif (!isset(Config::$Languagesdir)) { + elseif (!isset(Config::$languagesdir)) { // Define a few essential strings for now. Lang::$txt['error_db_connect_settings'] = 'Cannot connect to the database server.

Please check that the database info variables are correct in Settings.php.'; Lang::$txt['error_sourcefile_missing'] = 'Unable to find the Sources/%1$s file. Please make sure it was uploaded properly, and then try again.'; @@ -2981,10 +2981,10 @@ function cmdStep0() print_error('Error: Unable to obtain write access to "' . basename(SMF_SETTINGS_BACKUP_FILE) . '".'); } - if (isset(Config::$modSettings['agreement']) && (!is_writable(Config::$languagesdir) || file_exists(Config::$languagesdir . '/agreement.txt')) && !is_writable(Config::$languagesdir . '/agreement.txt')) { + if (isset(Config::$modSettings['agreement']) && (!is_writable(Config::$languagesdir) || file_exists(Config::$languagesdir . '/en_US/agreement.txt')) && !is_writable(Config::$languagesdir . '/en_US/agreement.txt')) { print_error('Error: Unable to obtain write access to "agreement.txt".'); } elseif (isset(Config::$modSettings['agreement'])) { - $fp = fopen(Config::$boarddir . '/agreement.txt', 'w'); + $fp = fopen(Config::$languagesdir . '/en_US/agreement.txt', 'w'); fwrite($fp, Config::$modSettings['agreement']); fclose($fp); } @@ -3017,22 +3017,22 @@ function cmdStep0() print_error('Error: Unable to obtain write access to "db_last_error.php".'); } - if (!file_exists(Config::$languagesdir . '/index.' . $upcontext['language'] . '.php')) { + if (!file_exists(Config::$languagesdir . '/' . $upcontext['language'] . '/General.php')) { print_error('Error: Unable to find language files!', true); } else { - $temp = substr(@implode('', @file(Config::$languagesdir . '/index.' . $upcontext['language'] . '.php')), 0, 4096); + $temp = substr(@implode('', @file(Config::$languagesdir . '/' . $upcontext['language'] . '/General.php')), 0, 4096); preg_match('~(?://|/\*)\s*Version:\s+(.+?);\s*index(?:[\s]{2}|\*/)~i', $temp, $match); if (empty($match[1]) || $match[1] != SMF_LANG_VERSION) { print_error('Error: Language files out of date.', true); } - if (!file_exists(Config::$languagesdir . '/Install.' . $upcontext['language'] . '.php')) { + if (!file_exists(Config::$languagesdir . '/' . $upcontext['language'] . '/Install.php')) { print_error('Error: Install language is missing for selected language.', true); } // Otherwise include it! - require_once Config::$languagesdir . '/Install.' . $upcontext['language'] . '.php'; + require_once Config::$languagesdir . '/' . $upcontext['language'] . '/Install.php'; } // Do we need to add this setting? @@ -3956,7 +3956,7 @@ function Cleanup() $cleanupSteps = array( 0 => 'CleanupLanguages', - 0 => 'CleanupAgreements' + 1 => 'CleanupAgreements' ); $upcontext['steps_count'] = count($cleanupSteps); @@ -4068,7 +4068,7 @@ function CleanupAgreements() if (substr($entry, 0, 11) == 'agreements.' || substr($entry, -4) !== '.txt') continue; - rename($Config::$boarddir . '/' . $entry, $Config::$languagesdir . '/' . $entry); + rename(Config::$boarddir . '/' . $entry, Config::$languagesdir . '/' . $entry); } $dir->close(); } @@ -5378,7 +5378,7 @@ function template_cleanup() // Dont any tables so far? if (!empty($upcontext['previous_substeps'])) - foreach ($upcontext['previous_substeps'] as $substep) + foreach ((array) $upcontext['previous_substeps'] as $substep) echo '
', Lang::$txt['completed_cleanup_step'], ' "', $substep, '".'; From 30150d3b02d9ff9b9f4b5f4f2acddfa998de414f Mon Sep 17 00:00:00 2001 From: jdarwood007 Date: Wed, 24 Jan 2024 17:20:43 -0800 Subject: [PATCH 17/35] More typos --- Sources/Actions/Admin/Registration.php | 20 ++++++++++---------- Sources/Actions/Register.php | 8 ++++---- Sources/Lang.php | 4 ++-- Sources/User.php | 2 +- other/update_version_numbers.php | 2 +- other/upgrade.php | 14 +++++++------- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Sources/Actions/Admin/Registration.php b/Sources/Actions/Admin/Registration.php index 451f634722..4c0ea490ff 100644 --- a/Sources/Actions/Admin/Registration.php +++ b/Sources/Actions/Admin/Registration.php @@ -216,27 +216,27 @@ public function agreement(): void // Is there more than one to edit? Utils::$context['editable_agreements'] = [ - '' => Lang::$txt['admin_agreement_default'], + 'en_US' => Lang::$txt['admin_agreement_default'], ]; // Get our languages. Lang::get(); // Try to figure out if we have more agreements. - foreach (Utils::$context['languages'] as $lang) { - if (file_exists(Config::$langaugesdir . '/agreement.' . $lang['filename'] . '.txt')) { - Utils::$context['editable_agreements']['.' . $lang['filename']] = $lang['name']; + foreach (Utils::$context['languages'] as $lang_id => $lang) { + if (file_exists(Config::$languagesdir . '/' . $lang_id . '/agreement.txt')) { + Utils::$context['editable_agreements'][$lang_id] = $lang['name']; // Are we editing this? - if (isset($_POST['agree_lang']) && $_POST['agree_lang'] == '.' . $lang['filename']) { - Utils::$context['current_agreement'] = '.' . $lang['filename']; + if (isset($_POST['agree_lang']) && $_POST['agree_lang'] == $lang_id) { + Utils::$context['current_agreement'] = $lang_id; } } } - $agreement_lang = empty(Utils::$context['current_agreement']) ? 'default' : substr(Utils::$context['current_agreement'], 1); + $agreement_lang = !empty(Utils::$context['current_agreement']) ? Utils::$context['current_agreement'] : 'en_US'; - $agreement_file = Config::$languagesdir . '/agreement' . Utils::$context['current_agreement'] . '.txt'; + $agreement_file = Config::$languagesdir . '/' . $agreement_lang . '/agreement.txt'; Utils::$context['agreement'] = file_exists($agreement_file) ? str_replace("\r", '', file_get_contents($agreement_file)) : ''; @@ -248,7 +248,7 @@ public function agreement(): void User::$me->checkSession(); SecurityToken::validate('admin-rega'); - $backup_file = (date_create('@' . filemtime($agreement_file))->format('Y-m-d\\TH_i_sp')) . '_' . $agreement_file; + $backup_file = dirname($agreement_file) . '/' .(date_create('@' . filemtime($agreement_file))->format('Y-m-d\\TH_i_sp')) . '_' . basename($agreement_file); // Off it goes to the agreement file. if (Config::safeFileWrite($agreement_file, $_POST['agreement'], $backup_file)) { @@ -281,7 +281,7 @@ public function agreement(): void Utils::$context['agreement'] = Utils::htmlspecialchars(Utils::$context['agreement']); - Utils::$context['warning'] = is_writable($agreement_file) ? '' : Lang::$txt['agreement_not_writable']; + Utils::$context['warning'] = is_writable($agreement_file) && is_writable(dirname($agreement_file)) ? '' : Lang::$txt['agreement_not_writable']; Utils::$context['sub_template'] = 'edit_agreement'; Utils::$context['page_title'] = Lang::$txt['registration_agreement']; diff --git a/Sources/Actions/Register.php b/Sources/Actions/Register.php index d3be63c54d..655e9c4d32 100644 --- a/Sources/Actions/Register.php +++ b/Sources/Actions/Register.php @@ -190,10 +190,10 @@ public function show(): void // If you have to agree to the agreement, it needs to be fetched from the file. if (!empty(Config::$modSettings['requireAgreement'])) { // Have we got a localized one? - if (file_exists(Config::$languagesdir . '/agreement.' . User::$me->language . '.txt')) { - Utils::$context['agreement'] = BBCodeParser::load()->parse(file_get_contents(Config::$languagesdir . '/agreement.' . User::$me->language . '.txt'), true, 'agreement_' . User::$me->language); - } elseif (file_exists(Config::$languagesdir . '/agreement.txt')) { - Utils::$context['agreement'] = BBCodeParser::load()->parse(file_get_contents(Config::$languagesdir . '/agreement.txt'), true, 'agreement'); + if (file_exists(Config::$languagesdir . '/' . User::$me->language . '/agreement.txt')) { + Utils::$context['agreement'] = BBCodeParser::load()->parse(file_get_contents(Config::$languagesdir . '/' . User::$me->language . '/agreement.txt'), true, 'agreement_' . User::$me->language); + } elseif (file_exists(Config::$languagesdir . '/en_US/agreement.txt')) { + Utils::$context['agreement'] = BBCodeParser::load()->parse(file_get_contents(Config::$languagesdir . '/en_US/agreement.txt'), true, 'agreement'); } else { Utils::$context['agreement'] = ''; } diff --git a/Sources/Lang.php b/Sources/Lang.php index 002d6e3a8c..8ac70a9b78 100644 --- a/Sources/Lang.php +++ b/Sources/Lang.php @@ -263,7 +263,7 @@ public static function load(string $template_name, string $lang = '', bool $fata // Keep track of what we're up to, soldier. if (!empty(Config::$db_show_debug)) { - Utils::$context['debug']['language_files'][] = $file[2] . '.' . $file[1] . ' (' . (Config::$languagesdir == $file[0] ? 'Base' : basename(Theme::$current->settings['theme_url'] ?? 'unknown')) . ')'; + Utils::$context['debug']['language_files'][] = $file[2] . '/' . $file[1] . ' (' . (Config::$languagesdir == $file[0] ? 'Base' : basename(Theme::$current->settings['theme_url'] ?? 'unknown')) . ')'; } // Copyright can't be empty. @@ -407,7 +407,7 @@ public static function get(bool $use_cache = true): array // Set the language's name. if (!empty($matchNative) && !empty($matchNative[1])) { // Don't mislabel the language if the translator missed this one. - if ($entry !== 'en_US' && $matchNative[1] === 'English') { + if ($entry !== 'en_US' && $matchNative[1] === 'English (US)') { break; } diff --git a/Sources/User.php b/Sources/User.php index 2c7bb6cf84..22b11f4e90 100644 --- a/Sources/User.php +++ b/Sources/User.php @@ -5272,7 +5272,7 @@ protected function setLanguage(): void $this->language = strtr($_SESSION['language'], './\\:', '____'); } // Can we locate it in the accept language? - elseif (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { + elseif (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && class_exists('\Locale')) { foreach (explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $match) { [$lang] = explode(';', $match); $lang = \Locale::canonicalize($lang); diff --git a/other/update_version_numbers.php b/other/update_version_numbers.php index 9f321a6735..d277ef0fdb 100644 --- a/other/update_version_numbers.php +++ b/other/update_version_numbers.php @@ -147,7 +147,7 @@ function ($filename) { } // Update SMF_LANG_VERSION -preg_match($lang_pattern, file_get_contents("{$basedir}/Languages/index.english.php"), $matches); +preg_match($lang_pattern, file_get_contents("{$basedir}/Languages/en_US/General.php"), $matches); $lang_version = $matches[0]; diff --git a/other/upgrade.php b/other/upgrade.php index f61c3e6c64..ea583e0ffa 100644 --- a/other/upgrade.php +++ b/other/upgrade.php @@ -540,14 +540,14 @@ function load_lang_file() $lang_dir = Config::$languagesdir; // Override the language file? - if (isset($upcontext['language']) && file_exists($lang_dir . '/' . $upcontext['language'] . '/Install.' . $upcontext['language'] . '.php')) { - $_SESSION['upgrader_langfile'] = $upcontext['language'] . '/Install.' . $upcontext['language'] . '.php'; - } elseif (isset($upcontext['lang']) && file_exists($lang_dir . '/' . $upcontext['lang'] . '/Install.' . $upcontext['lang'] . '.php')) { - $_SESSION['upgrader_langfile'] = $upcontext['lang'] . '/Install.' . $upcontext['lang'] . '.php'; - } elseif (isset(Config::$language) && file_exists($lang_dir . '/' . Config::$language . '/Install.' . Config::$language . '.php')) { - $_SESSION['upgrader_langfile'] = Config::$language . '/Install.' . Config::$language . '.php'; + if (isset($upcontext['language']) && file_exists($lang_dir . '/' . $upcontext['language'] . '/Install.php')) { + $_SESSION['upgrader_langfile'] = $upcontext['language'] . '/Install.php'; + } elseif (isset($upcontext['lang']) && file_exists($lang_dir . '/' . $upcontext['lang'] . '/Install.php')) { + $_SESSION['upgrader_langfile'] = $upcontext['lang'] . '/Install.php'; + } elseif (isset(Config::$language) && file_exists($lang_dir . '/' . Config::$language . '/Install.php')) { + $_SESSION['upgrader_langfile'] = Config::$language . '/Install.php'; } else { - $_SESSION['upgrader_langfile'] = Config::$language . '/Install.en_US.php'; + $_SESSION['upgrader_langfile'] = 'en_US/Install.php'; } // Avoid pointless repetition From 43f78cc68d1f91eaf88fd737cb1a1f0d64fac220 Mon Sep 17 00:00:00 2001 From: jdarwood007 Date: Wed, 24 Jan 2024 18:04:20 -0800 Subject: [PATCH 18/35] Fix install and upgrader --- .gitignore | 3 +++ Languages/en_US/General.php | 2 +- Languages/en_US/Install.php | 3 ++- other/install.php | 14 +++++++------- other/upgrade.php | 37 +++++++++++++++++++------------------ 5 files changed, 32 insertions(+), 27 deletions(-) diff --git a/.gitignore b/.gitignore index 3d5e05882e..a7a975ea6f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ # SMF Generated Files # ####################### +/Languages/* +!/Languages/index.php +!/Languages/en_US/ /Languages/en_US/agreement.txt Settings.php Settings_bak.php diff --git a/Languages/en_US/General.php b/Languages/en_US/General.php index 776a4baaaf..7be89e35a9 100644 --- a/Languages/en_US/General.php +++ b/Languages/en_US/General.php @@ -1,6 +1,6 @@ SMF will not work in this language without the language files installed.

Please either install them, or try English instead.'; +$txt['error_lang_general_missing'] = 'The upgrader was unable to find language files for the selected language, %1$s.
SMF will not work in this language without the language files installed.

Please either install them, or try English instead.'; $txt['error_upgrade_files_missing'] = 'The upgrader was unable to find some crucial files.

Please make sure you uploaded all of the files included in the package, including the Themes, Sources, and other directories.'; $txt['error_upgrade_old_files'] = 'The upgrader found some old or outdated files.

Please make certain you uploaded the new versions of all the files included in the package.'; $txt['error_upgrade_old_lang_files'] = 'The upgrader found some old or outdated language files for the selected language, %1$s.

Please make certain you uploaded the new versions of all the files included in the package, even the theme and language files for the default theme.
   [SKIP] [Try English]'; diff --git a/other/install.php b/other/install.php index ba6d55548c..3cfaf49f78 100644 --- a/other/install.php +++ b/other/install.php @@ -333,12 +333,12 @@ function load_lang_file() $dir = dir(Config::$languagesdir); while ($entry = $dir->read()) { - if (!is_dir(Config::$languagesdir . '/' . $entry) || !file_exists(Config::$languagesdir . '/' . $entry . '/' . 'Install.' . $entry . '.php') || !file_exists(Config::$languagesdir . '/' . $entry . '/' . 'index.' . $entry . '.php')) { + if (!is_dir(Config::$languagesdir . '/' . $entry) || !file_exists(Config::$languagesdir . '/' . $entry . '/' . 'Install.php') || !file_exists(Config::$languagesdir . '/' . $entry . '/' . 'General.php')) { continue; } // Get the line we need. - $fp = @fopen($language_dir . '/' . $entry . '/' . 'index.' . $entry . '.php', 'r'); + $fp = @fopen(Config::$languagesdir . '/' . $entry . '/' . 'General.php', 'r'); // Yay! if ($fp) @@ -354,7 +354,7 @@ function load_lang_file() if (!empty($matchNative) && !empty($matchNative[1])) { // Don't mislabel the language if the translator missed this one. - if ($entry !== 'en_US' && $matchNative[1] === 'English') + if ($entry !== 'en_US' && $matchNative[1] === 'English (US)') break; $langName = Utils::htmlspecialcharsDecode($matchNative[1]); @@ -419,18 +419,18 @@ function load_lang_file() } // Make sure it exists, if it doesn't reset it. - if (!isset($_SESSION['installer_temp_lang']) || preg_match('~[^\\w_\\-.]~', $_SESSION['installer_temp_lang']) === 1 || !file_exists(Config::$languagesdir . '/' . $_SESSION['installer_temp_lang'])) { + if (!isset($_SESSION['installer_temp_lang']) || preg_match('~[^\\w_\\-.]~', $_SESSION['installer_temp_lang']) === 1 || !file_exists(Config::$languagesdir . '/' . $_SESSION['installer_temp_lang'] . '/Install.php')) { // Use the first one... list($_SESSION['installer_temp_lang']) = array_keys($incontext['detected_languages']); // If we have english and some other language, use the other language. We Americans hate english :P. - if ($_SESSION['installer_temp_lang'] == 'Install.en_US.php' && count($incontext['detected_languages']) > 1) { + if ($_SESSION['installer_temp_lang'] == 'en_US' && count($incontext['detected_languages']) > 1) { list (, $_SESSION['installer_temp_lang']) = array_keys($incontext['detected_languages']); } } // Which language are we loading? Assume that the admin likes that language. - Config::$language = preg_replace('~^Install\.|(-utf8)?\.php$~', '', $_SESSION['installer_temp_lang']); + Config::$language = preg_replace('~^[A-Za-z0-9]+$~', '', $_SESSION['installer_temp_lang']); // Ensure SMF\Lang knows the path to the language directory. Lang::addDirs(Config::$languagesdir); @@ -594,7 +594,7 @@ function CheckFilesWritable() 'Packages', 'Smileys', 'Themes', - 'Languages/agreement.txt', + 'Languages/en_US/agreement.txt', 'Settings.php', 'Settings_bak.php', 'cache/db_last_error.php', diff --git a/other/upgrade.php b/other/upgrade.php index ea583e0ffa..3d340a9b97 100644 --- a/other/upgrade.php +++ b/other/upgrade.php @@ -541,17 +541,17 @@ function load_lang_file() // Override the language file? if (isset($upcontext['language']) && file_exists($lang_dir . '/' . $upcontext['language'] . '/Install.php')) { - $_SESSION['upgrader_langfile'] = $upcontext['language'] . '/Install.php'; + $_SESSION['upgrader_lang'] = $upcontext['language']; } elseif (isset($upcontext['lang']) && file_exists($lang_dir . '/' . $upcontext['lang'] . '/Install.php')) { - $_SESSION['upgrader_langfile'] = $upcontext['lang'] . '/Install.php'; + $_SESSION['upgrader_lang'] = $upcontext['lang']; } elseif (isset(Config::$language) && file_exists($lang_dir . '/' . Config::$language . '/Install.php')) { - $_SESSION['upgrader_langfile'] = Config::$language . '/Install.php'; + $_SESSION['upgrader_lang'] = Config::$language; } else { - $_SESSION['upgrader_langfile'] = 'en_US/Install.php'; + $_SESSION['upgrader_lang'] = 'en_US'; } - + // Avoid pointless repetition - if (isset($_SESSION['upgrader_langfile']) && $loaded_langfile == $lang_dir . '/' . $_SESSION['upgrader_langfile']) { + if (isset($_SESSION['upgrader_lang']) && $loaded_langfile == $lang_dir . '/' . $_SESSION['upgrader_lang'] . '/Install.php') { return; } @@ -568,7 +568,7 @@ function load_lang_file() } // Get the line we need. - $fp = @fopen(Config::$languagesdir . '/' . $entry . '/' . 'index.php', 'r'); + $fp = @fopen(Config::$languagesdir . '/' . $entry . '/' . 'General.php', 'r'); // Yay! if ($fp) { @@ -582,7 +582,7 @@ function load_lang_file() // Set the language's name. if (!empty($matchNative) && !empty($matchNative[1])) { // Don't mislabel the language if the translator missed this one. - if ($entry !== 'en_US' && $matchNative[1] === 'English') { + if ($entry !== 'en_US' && $matchNative[1] === 'English (US)') { break; } @@ -609,6 +609,7 @@ function load_lang_file() return; } + } // Didn't find any, show an error message! @@ -681,13 +682,13 @@ function load_lang_file() } // Make sure it exists. If it doesn't, reset it. - if (!isset($_SESSION['upgrader_langfile']) || preg_match('~[^\w.-]~', $_SESSION['upgrader_langfile']) === 1 || !file_exists($lang_dir . '/' . $_SESSION['upgrader_langfile'])) { + if (!isset($_SESSION['upgrader_lang']) || preg_match('~^[A-Za-z0-9_-]+$~', $_SESSION['upgrader_lang']) === 1 || !file_exists($lang_dir . '/' . $_SESSION['upgrader_lang'] . '/Install.php')) { // Use the first one... - list($_SESSION['upgrader_langfile']) = array_keys($detected_languages); + list($_SESSION['upgrader_lang']) = array_keys($detected_languages); // If we have English and some other language, use the other language. - if ($_SESSION['upgrader_langfile'] == 'Install.en_US.php' && count($detected_languages) > 1) { - list (, $_SESSION['upgrader_langfile']) = array_keys($detected_languages); + if ($_SESSION['upgrader_lang'] == 'en_US' && count($detected_languages) > 1) { + list (, $_SESSION['upgrader_lang']) = array_keys($detected_languages); } } @@ -695,10 +696,10 @@ function load_lang_file() Lang::addDirs($lang_dir); // And now load the language files. - Lang::load('General+Install', preg_replace('~^Install\.|\.php$~', '', $_SESSION['upgrader_langfile'])); + Lang::load('General+Install', $_SESSION['upgrader_lang']); // Remember what we've done - $loaded_langfile = $lang_dir . '/' . $_SESSION['upgrader_langfile']; + $loaded_langfile = $lang_dir . '/' . $_SESSION['upgrader_lang'] . '/Install.php'; } // Used to direct the user to another location. @@ -1029,12 +1030,12 @@ function WelcomeLogin() quickFileWritable($cachedir_temp . '/db_last_error.php'); - if (!file_exists(Config::$languagesdir . '/' . $upcontext['language'] . '/index.' . $upcontext['language'] . '.php')) { - return throw_error(sprintf(Lang::$txt['error_lang_index_missing'], $upcontext['language'], $upgradeurl)); + if (!file_exists(Config::$languagesdir . '/' . $upcontext['language'] . '/General.php')) { + return throw_error(sprintf(Lang::$txt['error_lang_general_missing'], $upcontext['language'], $upgradeurl)); } elseif (!isset($_GET['skiplang'])) { - $temp = substr(@implode('', @file(Config::$languagesdir . '/' . $upcontext['language'] . '/index.' . $upcontext['language'] . '.php')), 0, 4096); + $temp = substr(@implode('', @file(Config::$languagesdir . '/' . $upcontext['language'] . '/General.php')), 0, 4096); - preg_match('~(?://|/\*)\s*Version:\s+(.+?);\s*index(?:[\s]{2}|\*/)~i', $temp, $match); + preg_match('~(?://|/\*)\s*Version:\s+(.+?);\s*General(?:[\s]{2}|\*/)~i', $temp, $match); if (empty($match[1]) || $match[1] != SMF_LANG_VERSION) { return throw_error(sprintf(Lang::$txt['error_upgrade_old_lang_files'], $upcontext['language'], $upgradeurl)); From 4e78bdf00e70f650b6c202cd0b93e57fe086dcac Mon Sep 17 00:00:00 2001 From: jdarwood007 Date: Wed, 24 Jan 2024 18:09:04 -0800 Subject: [PATCH 19/35] Missed some logic --- other/upgrade.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/other/upgrade.php b/other/upgrade.php index 3d340a9b97..dd4a054608 100644 --- a/other/upgrade.php +++ b/other/upgrade.php @@ -1047,7 +1047,7 @@ function WelcomeLogin() } // Check agreement.txt. (it may not exist, in which case $boarddir must be writable.) - if (isset(Config::$modSettings['agreement']) && (!is_writable(Config::$languagesdir) || file_exists(Config::$languagesdir . '/agreement.txt')) && !is_writable(Config::$languagesdir . '/agreement.txt')) { + if (isset(Config::$modSettings['agreement']) && (!is_writable(Config::$languagesdir) || file_exists(Config::$languagesdir . '/en_US/agreement.txt')) && !is_writable(Config::$languagesdir . '/en_US/agreement.txt')) { return throw_error(Lang::$txt['error_agreement_not_writable']); } @@ -1368,14 +1368,14 @@ function checkLogin() $upcontext['upgrade_status']['pass'] = $upcontext['user']['pass']; // Set the language to that of the user? - if (isset($user_language) && $user_language != $upcontext['language'] && file_exists(Config::$languagesdir . '/index.' . basename($user_language, '.lng') . '.php')) { + if (isset($user_language) && $user_language != $upcontext['language'] && file_exists(Config::$languagesdir . '/' . $upcontext['language'] . '/General.php')) { $user_language = basename($user_language, '.lng'); - $temp = substr(@implode('', @file(Config::$languagesdir . '/index.' . $user_language . '.php')), 0, 4096); - preg_match('~(?://|/\*)\s*Version:\s+(.+?);\s*index(?:[\s]{2}|\*/)~i', $temp, $match); + $temp = substr(@implode('', @file(Config::$languagesdir . '/' . $upcontext['language'] . '/General.php')), 0, 4096); + preg_match('~(?://|/\*)\s*Version:\s+(.+?);\s*General(?:[\s]{2}|\*/)~i', $temp, $match); if (empty($match[1]) || $match[1] != SMF_LANG_VERSION) { $upcontext['upgrade_options_warning'] = sprintf(Lang::$txt['warning_lang_old'], $user_language, $upcontext['language']); - } elseif (!file_exists(Config::$languagesdir . '/Install.' . $user_language . '.php')) { + } elseif (!file_exists(Config::$languagesdir . '/' . $user_language . 'Install.php')) { $upcontext['upgrade_options_warning'] = sprintf(Lang::$txt['warning_lang_missing'], $user_language, $upcontext['language']); } else { // Set this as the new language. From cac524cb66244c4e40f4ef66b8387d989a4e135a Mon Sep 17 00:00:00 2001 From: jdarwood007 Date: Wed, 24 Jan 2024 18:12:11 -0800 Subject: [PATCH 20/35] CS fixer wouldn't find these. --- Sources/Actions/Admin/Registration.php | 2 +- other/upgrade.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Sources/Actions/Admin/Registration.php b/Sources/Actions/Admin/Registration.php index 4c0ea490ff..fe3da62760 100644 --- a/Sources/Actions/Admin/Registration.php +++ b/Sources/Actions/Admin/Registration.php @@ -248,7 +248,7 @@ public function agreement(): void User::$me->checkSession(); SecurityToken::validate('admin-rega'); - $backup_file = dirname($agreement_file) . '/' .(date_create('@' . filemtime($agreement_file))->format('Y-m-d\\TH_i_sp')) . '_' . basename($agreement_file); + $backup_file = dirname($agreement_file) . '/' . (date_create('@' . filemtime($agreement_file))->format('Y-m-d\\TH_i_sp')) . '_' . basename($agreement_file); // Off it goes to the agreement file. if (Config::safeFileWrite($agreement_file, $_POST['agreement'], $backup_file)) { diff --git a/other/upgrade.php b/other/upgrade.php index dd4a054608..621b1a29ea 100644 --- a/other/upgrade.php +++ b/other/upgrade.php @@ -1527,7 +1527,7 @@ function UpgradeOptions() } // If we're overriding the language follow it through. - if (isset($upcontext['lang']) && file_exists(Config::$languagesdir . '/index.' . $upcontext['lang'] . '.php')) { + if (isset($upcontext['lang']) && file_exists(Config::$languagesdir . '/' . $upcontext['lang'] . '/General.php')) { $changes['language'] = $upcontext['lang']; } @@ -1600,8 +1600,9 @@ function UpgradeOptions() } // Languages have moved! - if (empty(Config::$languagesdir)) + if (empty(Config::$languagesdir)) { $changes['languagesdir'] = fixRelativePath(Config::$boarddir) . '/Languages'; + } // Add support for $tasksdir var. if (empty(Config::$tasksdir)) { From bf8e85f17aef75e22be9cb7bb5868015c233e41e Mon Sep 17 00:00:00 2001 From: jdarwood007 Date: Thu, 25 Jan 2024 17:04:52 -0800 Subject: [PATCH 21/35] Fix issue with a redirect loop if language is set in the old_url session data Fix issue with users that have a session language unable to affect the forum language when changing with ?language Fix issue that locale detection affects logged in users who have defined a language --- Sources/User.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/User.php b/Sources/User.php index 22b11f4e90..c2145612a3 100644 --- a/Sources/User.php +++ b/Sources/User.php @@ -5258,13 +5258,14 @@ protected function setLanguage(): void // Make it permanent for members. if (!empty($this->id)) { self::updateMemberData($this->id, ['lngfile' => $this->language]); + unset($_SESSION['language']); } else { $_SESSION['language'] = $this->language; } // Reload same URL with new language, if applicable. if (isset($_SESSION['old_url'])) { - Utils::redirectexit($_SESSION['old_url']); + Utils::redirectexit(preg_replace('~language=[^;&$]+~i', '', $_SESSION['old_url'])); } } // Carry forward the last language request in this session, if any. @@ -5272,7 +5273,7 @@ protected function setLanguage(): void $this->language = strtr($_SESSION['language'], './\\:', '____'); } // Can we locate it in the accept language? - elseif (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && class_exists('\Locale')) { + elseif ($this->id === 0 && empty($_SESSION['language']) && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && class_exists('\Locale')) { foreach (explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $match) { [$lang] = explode(';', $match); $lang = \Locale::canonicalize($lang); From 547029ed61e5ad79eeb97c1fe70ad25d24ff7241 Mon Sep 17 00:00:00 2001 From: jdarwood007 Date: Thu, 25 Jan 2024 17:14:25 -0800 Subject: [PATCH 22/35] Fix #8043 --- Sources/Lang.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/Lang.php b/Sources/Lang.php index 8ac70a9b78..7a5c191d4b 100644 --- a/Sources/Lang.php +++ b/Sources/Lang.php @@ -199,6 +199,9 @@ public static function load(string $template_name, string $lang = '', bool $fata // Try to find the language file. $found = false; + // Flip this around. + $attempts = array_reverse($attempts); + foreach ($attempts as $k => $file) { if (file_exists($file[0] . '/' . $file[2] . '/' . $file[1] . '.php')) { /** @@ -250,8 +253,6 @@ public static function load(string $template_name, string $lang = '', bool $fata setlocale(LC_CTYPE, $locale_variants); } - - break; } } From 45747c6ee847df4abc21dec2e31f3cbcca1a9a4a Mon Sep 17 00:00:00 2001 From: jdarwood007 Date: Fri, 26 Jan 2024 17:18:56 -0800 Subject: [PATCH 23/35] Add some logic so the upgrader can know how to handle the new locale for UTF-8 migration. --- Sources/Lang.php | 84 +++++++++++++++++++++++++++++++++++++++++++++++ other/upgrade.php | 11 +++++++ 2 files changed, 95 insertions(+) diff --git a/Sources/Lang.php b/Sources/Lang.php index 7a5c191d4b..f212840652 100644 --- a/Sources/Lang.php +++ b/Sources/Lang.php @@ -622,6 +622,90 @@ public static function numberFormat(int|float|string $number, ?int $decimals = n self::$thousands_separator, ); } + + /** + * Mapper for old Language names to locales. + * This is the full array. Languages can map to: + * - null: No translation, langauge is removed and no UTF-8 upgrade possible. + * - Same locales: Merging language into the same locale. + * + * This MAY NOT map the same name to multiple locales. + * This is used to support Upgrading from SMF 2.1 and below. + * + * @return array Key/Value array with Key being the old name and value the locale. + */ + public static function oldLanguageMap(): array + { + /** + * Some notes: + * - english_pirate isn't a real language, so we use the _x_ to mark it as a 'private language'. + * - Various languages had 'informal', these are not a locale, so we typically just mapped these to the 'root' + * */ + return [ + 'albanian' => 'sq_AL', + 'arabic' => 'ar_001', // 001 is the region code the whole world, so this means modern standard Arabic. + 'bulgarian' => 'bg_BG', + 'cambodian' => 'km_KH', + 'catalan' => 'ca_ES', + 'chinese-simplified' => 'zh_Hans', // Hans indicates the script rather than a country. + 'chinese-traditional' => 'zh_Hant', // Hant indicates the script rather than a country. + 'croatian' => 'hr_HR', + 'czech' => 'cs_CZ', + 'czech_informal' => 'cs', + 'danish' => 'da_DK', + 'dutch' => 'nl_NL', + 'english' => 'en_US', + 'english_british' => 'en_GB', + 'english_pirate' => 'en_x_pirate', + 'esperanto' => 'eo', + 'finnish' => 'fi_FI', + 'french' => 'fr_FR', + 'galician' => 'gl_ES', + 'german' => 'de_DE', + 'german_informal' => 'de', + 'greek' => 'el_GR', + 'hebrew' => 'he_IL', + 'hungarian' => 'hu_HU', + 'indonesian' => 'id_ID', + 'italian' => 'it_IT', + 'japanese' => 'ja_JP', + 'lithuanian' => 'lt_LT', + 'macedonian' => 'mk_MK', + 'malay' => 'ms_MY', + 'norwegian' => 'nb_NO', + 'persian' => 'fa_IR', + 'polish' => 'pl_PL', + 'portuguese_brazilian' => 'pt_BR', + 'portuguese_pt' => 'pt_PT', + 'romanian' => 'ro_RO', + 'russian' => 'ru_RU', + 'serbian_cyrillic' => 'sr_Cyrl', // Cyrl indicates Cyrillic script. + 'serbian_latin' => 'sr_Latn', // Latn indicates Latin script. + 'slovak' => 'sk_SK', + 'slovenian' => 'sl_SI', + 'spanish_es' => 'es_ES', + 'spanish_latin' => 'es_419', // 419 is the region code for Latin America. + 'swedish' => 'sv_SE', + 'thai' => 'th_TH', + 'turkish' => 'tr_TR', + 'ukrainian' => 'uk_UA', + 'urdu' => 'ur_PK', + 'vietnamese' => 'vi_VN', + ]; + } + + /** + * Given a old language naming, this will return the locale name. + * This is used to support upgrading from SMF 2.1 and below. + * This is also used to support compatibility for customizations. + * + * @param string $lang Language name + * @return ?string Locale is returned if found, null otherwise. + */ + public static function getLocaleFromLanguageName(string $lang): ?string + { + return self::oldLanguageMap()[$lang] ?? null; + } } // Export properties to global namespace for backward compatibility. diff --git a/other/upgrade.php b/other/upgrade.php index 621b1a29ea..fa3d6ba701 100644 --- a/other/upgrade.php +++ b/other/upgrade.php @@ -3278,6 +3278,17 @@ function ConvertUtf8() 'yoruba' => 'UTF-8', ]; + // Map in the new locales. We do it like this, because we want to try our best to capture + // the correct charset no mater what the status of the language upgrade is. + foreach ($lang_charsets as $key => $value) { + // This could be more efficient, but its upgrade logic. + $locale = Lang::getLocaleFromLanguageName($key); + + if ($locale !== null) { + $lang_charsets[$locale] = $value; + } + } + // Default to ISO-8859-1 unless we detected another supported charset $upcontext['charset_detected'] = (isset($lang_charsets[Config::$language], $charsets[strtr(strtolower($upcontext['charset_detected']), ['utf' => 'UTF', 'iso' => 'ISO'])])) ? $lang_charsets[Config::$language] : 'ISO-8859-1'; From 38852852969dbcbea9612bfe5a105ed579681ec7 Mon Sep 17 00:00:00 2001 From: jdarwood007 Date: Fri, 26 Jan 2024 18:39:41 -0800 Subject: [PATCH 24/35] Add logic to convert our languages during upgrade --- Languages/en_US/Install.php | 3 + other/upgrade.php | 135 +++++++++++++++++++------------ other/upgrade_3-0_MySQL.sql | 68 +++++++++++++++- other/upgrade_3-0_PostgreSQL.sql | 68 +++++++++++++++- 4 files changed, 222 insertions(+), 52 deletions(-) diff --git a/Languages/en_US/Install.php b/Languages/en_US/Install.php index 6880ce9fae..1a4b9ee5df 100644 --- a/Languages/en_US/Install.php +++ b/Languages/en_US/Install.php @@ -344,6 +344,9 @@ $txt['upgrade_completed_time_s'] = 'Upgrade completed in %1$s seconds'; $txt['upgrade_success_time_db'] = 'Successful! Database upgrades completed in %3$d hours, %2$d minutes and %1$d seconds.'; +$txt['upgrade_cleanup_completed'] = 'Cleanup has completed'; +$txt['upgrade_current_step'] = 'Current Step'; + $txt['upgrade_unsuccessful'] = 'Unsuccessful!'; $txt['upgrade_thisquery'] = 'This query:'; $txt['upgrade_causerror'] = 'Caused the error:'; diff --git a/other/upgrade.php b/other/upgrade.php index fa3d6ba701..c3267c4c2f 100644 --- a/other/upgrade.php +++ b/other/upgrade.php @@ -549,7 +549,7 @@ function load_lang_file() } else { $_SESSION['upgrader_lang'] = 'en_US'; } - + // Avoid pointless repetition if (isset($_SESSION['upgrader_lang']) && $loaded_langfile == $lang_dir . '/' . $_SESSION['upgrader_lang'] . '/Install.php') { return; @@ -563,6 +563,11 @@ function load_lang_file() $dir = dir($lang_dir); while ($entry = $dir->read()) { + // We can't have periods. + if (strpos($entry, '.') !== false) { + continue; + } + if (!is_dir(Config::$languagesdir . '/' . $entry) || !file_exists(Config::$languagesdir . '/' . $entry . '/' . 'Install.php') || !file_exists(Config::$languagesdir . '/' . $entry . '/' . 'General.php')) { continue; } @@ -688,7 +693,7 @@ function load_lang_file() // If we have English and some other language, use the other language. if ($_SESSION['upgrader_lang'] == 'en_US' && count($detected_languages) > 1) { - list (, $_SESSION['upgrader_lang']) = array_keys($detected_languages); + list(, $_SESSION['upgrader_lang']) = array_keys($detected_languages); } } @@ -1032,7 +1037,9 @@ function WelcomeLogin() if (!file_exists(Config::$languagesdir . '/' . $upcontext['language'] . '/General.php')) { return throw_error(sprintf(Lang::$txt['error_lang_general_missing'], $upcontext['language'], $upgradeurl)); - } elseif (!isset($_GET['skiplang'])) { + } + + if (!isset($_GET['skiplang'])) { $temp = substr(@implode('', @file(Config::$languagesdir . '/' . $upcontext['language'] . '/General.php')), 0, 4096); preg_match('~(?://|/\*)\s*Version:\s+(.+?);\s*General(?:[\s]{2}|\*/)~i', $temp, $match); @@ -1042,6 +1049,18 @@ function WelcomeLogin() } } + // Do we need to update our Settings file with the new language locale? + $current_language = Config::$language; + $new_locale = Lang::getLocaleFromLanguageName($current_language); + + if ($new_locale !== null) { + Config::updateSettingsFile(['language' => $new_locale]); + } + + if (empty(Config::$languagesdir)) { + Config::updateSettingsFile(['languagesdir' => Config::$boarddir . '/Languages']); + } + if (!makeFilesWritable($writable_files)) { return false; } @@ -1375,7 +1394,7 @@ function checkLogin() if (empty($match[1]) || $match[1] != SMF_LANG_VERSION) { $upcontext['upgrade_options_warning'] = sprintf(Lang::$txt['warning_lang_old'], $user_language, $upcontext['language']); - } elseif (!file_exists(Config::$languagesdir . '/' . $user_language . 'Install.php')) { + } elseif (!file_exists(Config::$languagesdir . '/' . $user_language . '/Install.php')) { $upcontext['upgrade_options_warning'] = sprintf(Lang::$txt['warning_lang_missing'], $user_language, $upcontext['language']); } else { // Set this as the new language. @@ -3078,9 +3097,10 @@ function ConvertUtf8() if (!empty($_POST['utf8_done'])) { if ($command_line) { return Cleanup(); - } else { - return true; } + + return true; + } // First make sure they aren't already on UTF-8 before we go anywhere... @@ -3095,9 +3115,10 @@ function ConvertUtf8() if ($command_line) { return Cleanup(); - } else { - return true; } + + return true; + } $upcontext['page_title'] = Lang::$txt['converting_utf8']; @@ -3961,73 +3982,80 @@ function Cleanup() global $command_line, $upcontext, $support_js, $txt; $upcontext['sub_template'] = isset($_GET['xml']) ? 'cleanup_xml' : 'cleanup'; - $upcontext['page_title'] = Lang::$txt['upgrade_cleanup']; + $upcontext['page_title'] = Lang::$txt['upgrade_step_cleanup']; // Done it already - js wise? - if (!empty($_POST['cleanup_done'])) + if (!empty($_POST['cleanup_done'])) { return true; + } - $cleanupSteps = array( + $cleanupSteps = [ 0 => 'CleanupLanguages', - 1 => 'CleanupAgreements' - ); + 1 => 'CleanupAgreements', + ]; $upcontext['steps_count'] = count($cleanupSteps); $upcontext['cur_substep_num'] = ((int) $_GET['substep']) ?? 0; - $upcontext['cur_substep'] = isset($cleanupSteps[$upcontext['cur_substep_num']]) ? $cleanupSteps[$upcontext['cur_substep_num']] : $cleanupSteps[0]; - $upcontext['cur_substep_name'] = isset($txt['cleanup_' . $upcontext['cur_substep']]) ? $txt['cleanup_' . $upcontext['cur_substep']] : $txt['upgrade_cleanup']; + $upcontext['cur_substep'] = $cleanupSteps[$upcontext['cur_substep_num']] ?? $cleanupSteps[0]; + $upcontext['cur_substep_name'] = $txt['cleanup_' . $upcontext['cur_substep']] ?? $txt['upgrade_step_cleanup']; $upcontext['step_progress'] = (int) (($upcontext['cur_substep_num'] / $upcontext['steps_count']) * 100); - foreach ($cleanupSteps as $id => $substep) - if ($id < $_GET['substep']) + foreach ($cleanupSteps as $id => $substep) { + if ($id < $_GET['substep']) { $upcontext['previous_substeps'][] = $substep; + } + } - if ($command_line) + if ($command_line) { echo 'Cleaning up.'; + } - if (!$support_js || isset($_GET['xml'])) - { + if (!$support_js || isset($_GET['xml'])) { // Dubstep. - for ($substep = $upcontext['cur_substep_num']; $substep < $upcontext['steps_count']; $substep++) - { + for ($substep = $upcontext['cur_substep_num']; $substep < $upcontext['steps_count']; $substep++) { $upcontext['step_progress'] = (int) (($substep / $upcontext['steps_count']) * 100); - $upcontext['cur_substep_name'] = isset($txt['cleanup_' . $cleanupSteps[$substep]]) ? $txt['cleanup_' . $cleanupSteps[$substep]] : $txt['upgrade_cleanup']; + $upcontext['cur_substep_name'] = $txt['cleanup_' . $cleanupSteps[$substep]] ?? $txt['upgrade_step_cleanup']; $upcontext['cur_substep_num'] = $substep + 1; - if ($command_line) + if ($command_line) { echo "\n" . ' +++ Clean up \"' . $upcontext['cur_substep_name'] . '"...'; + } // Timeouts nextSubstep($substep); - if ($command_line) + if ($command_line) { echo ' done.'; + } // Just to make sure it doesn't time out. - if (function_exists('apache_reset_timeout')) + if (function_exists('apache_reset_timeout')) { @apache_reset_timeout(); + } // Do the cleanup stuff. $cleanupSteps[$substep](); // If this is XML to keep it nice for the user do one cleanup at a time anyway! - if (isset($_GET['xml'])) + if (isset($_GET['xml'])) { return upgradeExit(); + } } - if ($command_line) - { + if ($command_line) { echo "\n" . 'Successful.' . "\n"; flush(); } $upcontext['step_progress'] = 100; $_GET['substep'] = 0; + return true; } // If this fails we just move on to deleting the upgrade anyway... $_GET['substep'] = 0; + return false; } @@ -4035,30 +4063,32 @@ function CleanupLanguages() { global $upcontext, $upgrade_path, $command_line; - $old_languages_dir = isset(Config::$modSettings['theme_dir']) ? Config::$modSettings['theme_dir'] . '/languages' : $upgrade_path . '/Themes/default/languages';; + $old_languages_dir = isset(Config::$modSettings['theme_dir']) ? Config::$modSettings['theme_dir'] . '/languages' : $upgrade_path . '/Themes/default/languages'; // Can't do this if the old Themes/default/languages directory is not writable. - if(!quickFileWritable($old_languages_dir)) + if(!quickFileWritable($old_languages_dir)) { return; + } $dir = dir($old_languages_dir); - while ($entry = $dir->read()) - { - if (in_array($entry, ['.', '..', 'index.php'])) + + while ($entry = $dir->read()) { + if (in_array($entry, ['.', '..', 'index.php'])) { continue; + } // Skip ThemeStrings - if (substr($entry, 0, 13) == 'ThemeStrings.') + if (substr($entry, 0, 13) == 'ThemeStrings.') { continue; + } // Rename Settings to ThemeStrings. - if (substr($entry, 0, 9) == 'Settings.' && substr($entry, -4) == '.php' && strpos($entry, '-utf8') === false) - { + if (substr($entry, 0, 9) == 'Settings.' && substr($entry, -4) == '.php' && strpos($entry, '-utf8') === false) { quickFileWritable($old_languages_dir . '/' . $entry); rename($old_languages_dir . '/' . $entry, $old_languages_dir . '/' . str_replace('Settings.', 'ThemeStrings.', $entry)); - } - else + } else { deleteFile($old_languages_dir . '/' . $entry); + } } $dir->close(); } @@ -4068,18 +4098,21 @@ function CleanupAgreements() global $upcontext, $upgrade_path, $command_line; // Can't do this if the old Themes/default/languages directory is not writable. - if(!quickFileWritable(Config::$boarddir)) + if(!quickFileWritable(Config::$boarddir)) { return; + } $dir = dir(Config::$boarddir); - while ($entry = $dir->read()) - { - if (in_array($entry, ['.', '..', 'index.php'])) + + while ($entry = $dir->read()) { + if (in_array($entry, ['.', '..', 'index.php'])) { continue; + } // Skip anything not agreements. - if (substr($entry, 0, 11) == 'agreements.' || substr($entry, -4) !== '.txt') + if (substr($entry, 0, 11) == 'agreements.' || substr($entry, -4) !== '.txt') { continue; + } rename(Config::$boarddir . '/' . $entry, Config::$languagesdir . '/' . $entry); } @@ -5381,7 +5414,7 @@ function template_cleanup() global $upcontext, $support_js, $is_debug; echo ' -

', Lang::$txt['upgrade_cleanup'], '

+

', Lang::$txt['upgrade_step_cleanup'], '

', Lang::$txt['upgrade_completed'], ' ', $upcontext['cur_substep_num'], ' ', Lang::$txt['upgrade_outof'], ' ', $upcontext['steps_count'], ' ', Lang::$txt['upgrade_steps'], ' @@ -5390,10 +5423,12 @@ function template_cleanup() '; // Dont any tables so far? - if (!empty($upcontext['previous_substeps'])) - foreach ((array) $upcontext['previous_substeps'] as $substep) + if (!empty($upcontext['previous_substeps'])) { + foreach ((array) $upcontext['previous_substeps'] as $substep) { echo '
', Lang::$txt['completed_cleanup_step'], ' "', $substep, '".'; + } + } echo '

@@ -5405,8 +5440,7 @@ function template_cleanup() $upcontext['continue'] = $support_js ? 2 : 1; // If javascript allows we want to do this using XML. - if ($support_js) - { + if ($support_js) { echo '