diff --git a/js/src/ajax.js b/js/src/ajax.js index 5d6cd1d71d..291ecffac8 100644 --- a/js/src/ajax.js +++ b/js/src/ajax.js @@ -699,10 +699,10 @@ var AJAX = { // Clear loaded scripts if they are from another version of phpMyAdmin. // Depends on common params being set before loading scripts in responseHandler if (self.scriptsVersion === null) { - self.scriptsVersion = CommonParams.get('PMA_VERSION'); - } else if (self.scriptsVersion !== CommonParams.get('PMA_VERSION')) { + self.scriptsVersion = CommonParams.get('version'); + } else if (self.scriptsVersion !== CommonParams.get('version')) { self.scripts = []; - self.scriptsVersion = CommonParams.get('PMA_VERSION'); + self.scriptsVersion = CommonParams.get('version'); } self.scriptsCompleted = false; self.scriptsToBeFired = []; @@ -772,7 +772,7 @@ var AJAX = { script.type = 'text/javascript'; var file = name.indexOf('vendor/') !== -1 ? name : 'dist/' + name; - script.src = 'js/' + file + '?' + 'v=' + encodeURIComponent(CommonParams.get('PMA_VERSION')); + script.src = 'js/' + file + '?' + 'v=' + encodeURIComponent(CommonParams.get('version')); script.async = false; script.onload = function () { self.done(name, callback); diff --git a/libraries/classes/Config.php b/libraries/classes/Config.php index cb9b8794bc..53351e4934 100644 --- a/libraries/classes/Config.php +++ b/libraries/classes/Config.php @@ -137,9 +137,6 @@ class Config */ public function checkSystem(): void { - // All the version handling is now done in the Version class - $this->set('PMA_VERSION', Version::VERSION); - $this->checkWebServerOs(); $this->checkWebServer(); $this->checkGd2(); @@ -1052,7 +1049,6 @@ class Config $GLOBALS['is_https'] = $this->get('is_https'); $defines = [ - 'PMA_VERSION', 'PMA_IS_WINDOWS', 'PMA_IS_GD2', 'PMA_USR_OS', diff --git a/libraries/classes/Controllers/HomeController.php b/libraries/classes/Controllers/HomeController.php index dda1f8b0aa..0a0dfe784b 100644 --- a/libraries/classes/Controllers/HomeController.php +++ b/libraries/classes/Controllers/HomeController.php @@ -247,7 +247,7 @@ class HomeController extends AbstractController 'web_server' => $webServer, 'show_php_info' => $cfg['ShowPhpInfo'], 'is_version_checked' => $cfg['VersionCheck'], - 'phpmyadmin_version' => PMA_VERSION, + 'phpmyadmin_version' => Version::VERSION, 'phpmyadmin_major_version' => Version::SERIES, 'config_storage_message' => $configStorageMessage ?? '', 'has_theme_manager' => $cfg['ThemeManager'], diff --git a/libraries/classes/ErrorReport.php b/libraries/classes/ErrorReport.php index 77855133b9..80838df816 100644 --- a/libraries/classes/ErrorReport.php +++ b/libraries/classes/ErrorReport.php @@ -80,7 +80,7 @@ class ErrorReport $relParams = $this->relation->getRelationsParam(); // common params for both, php & js exceptions $report = [ - 'pma_version' => PMA_VERSION, + 'pma_version' => Version::VERSION, 'browser_name' => PMA_USR_BROWSER_AGENT, 'browser_version' => PMA_USR_BROWSER_VER, 'user_os' => PMA_USR_OS, diff --git a/libraries/classes/Header.php b/libraries/classes/Header.php index a64d9260b8..53bcc66f02 100644 --- a/libraries/classes/Header.php +++ b/libraries/classes/Header.php @@ -256,7 +256,7 @@ class Header 'is_https' => $GLOBALS['config']->isHttps(), 'rootPath' => $GLOBALS['config']->getRootPath(), 'arg_separator' => Url::getArgSeparator(), - 'PMA_VERSION' => PMA_VERSION, + 'version' => Version::VERSION, ]; if (isset($GLOBALS['cfg']['Server'], $GLOBALS['cfg']['Server']['auth_type'])) { $params['auth_type'] = $GLOBALS['cfg']['Server']['auth_type']; @@ -369,7 +369,7 @@ class Header public function enablePrintView(): void { $this->disableMenuAndConsole(); - $this->setTitle(__('Print view') . ' - phpMyAdmin ' . PMA_VERSION); + $this->setTitle(__('Print view') . ' - phpMyAdmin ' . Version::VERSION); $this->isPrintView = true; } @@ -710,7 +710,7 @@ class Header */ public static function getVersionParameter(): string { - return 'v=' . urlencode(PMA_VERSION); + return 'v=' . urlencode(Version::VERSION); } private function getVariablesForJavaScript(): string diff --git a/libraries/classes/OpenDocument.php b/libraries/classes/OpenDocument.php index 2551883805..da36a6638c 100644 --- a/libraries/classes/OpenDocument.php +++ b/libraries/classes/OpenDocument.php @@ -44,8 +44,8 @@ EOT; . 'xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" ' . 'office:version="1.0">' . '' - . 'phpMyAdmin ' . PMA_VERSION . '' - . 'phpMyAdmin ' . PMA_VERSION + . 'phpMyAdmin ' . Version::VERSION . '' + . 'phpMyAdmin ' . Version::VERSION . '' . '' . strftime('%Y-%m-%dT%H:%M:%S') . '' diff --git a/libraries/classes/Pdf.php b/libraries/classes/Pdf.php index ae40983745..fbc0a158e1 100644 --- a/libraries/classes/Pdf.php +++ b/libraries/classes/Pdf.php @@ -65,7 +65,7 @@ class Pdf extends TCPDF $diskcache, $pdfa ); - $this->SetAuthor('phpMyAdmin ' . PMA_VERSION); + $this->SetAuthor('phpMyAdmin ' . Version::VERSION); $this->AddFont('DejaVuSans', '', 'dejavusans.php'); $this->AddFont('DejaVuSans', 'B', 'dejavusansb.php'); $this->SetFont(self::PMA_PDF_FONT, '', 14); diff --git a/libraries/classes/Plugins/Export/ExportJson.php b/libraries/classes/Plugins/Export/ExportJson.php index 23d4777b78..5a9262bfb0 100644 --- a/libraries/classes/Plugins/Export/ExportJson.php +++ b/libraries/classes/Plugins/Export/ExportJson.php @@ -15,6 +15,7 @@ use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyRootGroup; use PhpMyAdmin\Properties\Options\Items\BoolPropertyItem; use PhpMyAdmin\Properties\Options\Items\HiddenPropertyItem; use PhpMyAdmin\Properties\Plugins\ExportPluginProperties; +use PhpMyAdmin\Version; use function bin2hex; use function explode; @@ -122,7 +123,7 @@ class ExportJson extends ExportPlugin $meta = [ 'type' => 'header', - 'version' => PMA_VERSION, + 'version' => Version::VERSION, 'comment' => 'Export to JSON plugin for PHPMyAdmin', ]; diff --git a/libraries/classes/Plugins/Export/ExportLatex.php b/libraries/classes/Plugins/Export/ExportLatex.php index dc5e41eceb..d92d211fc6 100644 --- a/libraries/classes/Plugins/Export/ExportLatex.php +++ b/libraries/classes/Plugins/Export/ExportLatex.php @@ -16,6 +16,7 @@ use PhpMyAdmin\Properties\Options\Items\RadioPropertyItem; use PhpMyAdmin\Properties\Options\Items\TextPropertyItem; use PhpMyAdmin\Properties\Plugins\ExportPluginProperties; use PhpMyAdmin\Util; +use PhpMyAdmin\Version; use function count; use function in_array; @@ -214,7 +215,7 @@ class ExportLatex extends ExportPlugin global $crlf, $cfg, $dbi; $head = '% phpMyAdmin LaTeX Dump' . $crlf - . '% version ' . PMA_VERSION . $crlf + . '% version ' . Version::VERSION . $crlf . '% https://www.phpmyadmin.net/' . $crlf . '%' . $crlf . '% ' . __('Host:') . ' ' . $cfg['Server']['host']; diff --git a/libraries/classes/Plugins/Export/ExportPhparray.php b/libraries/classes/Plugins/Export/ExportPhparray.php index 3f93ef9392..d05ee8f0e4 100644 --- a/libraries/classes/Plugins/Export/ExportPhparray.php +++ b/libraries/classes/Plugins/Export/ExportPhparray.php @@ -14,6 +14,7 @@ use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyRootGroup; use PhpMyAdmin\Properties\Options\Items\HiddenPropertyItem; use PhpMyAdmin\Properties\Plugins\ExportPluginProperties; use PhpMyAdmin\Util; +use PhpMyAdmin\Version; use function preg_match; use function preg_replace; @@ -88,7 +89,7 @@ class ExportPhparray extends ExportPlugin 'exportComment('phpMyAdmin SQL Dump') - . $this->exportComment('version ' . PMA_VERSION) + . $this->exportComment('version ' . Version::VERSION) . $this->exportComment('https://www.phpmyadmin.net/') . $this->exportComment(); $host_string = __('Host:') . ' ' . $cfg['Server']['host']; diff --git a/libraries/classes/Plugins/Export/ExportXml.php b/libraries/classes/Plugins/Export/ExportXml.php index 6c5dbbd808..82e11b5c5e 100644 --- a/libraries/classes/Plugins/Export/ExportXml.php +++ b/libraries/classes/Plugins/Export/ExportXml.php @@ -15,6 +15,7 @@ use PhpMyAdmin\Properties\Options\Items\BoolPropertyItem; use PhpMyAdmin\Properties\Options\Items\HiddenPropertyItem; use PhpMyAdmin\Properties\Plugins\ExportPluginProperties; use PhpMyAdmin\Util; +use PhpMyAdmin\Version; use function count; use function htmlspecialchars; @@ -248,7 +249,7 @@ class ExportXml extends ExportPlugin $head = '' . $crlf . '