Remove PMA_PATH_TO_BASEDIR constant

It's always an empty string.

Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
This commit is contained in:
Maurício Meneghini Fauth 2025-07-07 19:40:41 -03:00
parent de50d366ca
commit 120f5ae847
No known key found for this signature in database
GPG Key ID: 6A16FD38AFC89CC8
8 changed files with 5 additions and 31 deletions

View File

@ -14,9 +14,9 @@
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="{{ header.theme_path }}/jquery/jquery-ui.css">
<link rel="stylesheet" type="text/css" href="{{ header.base_dir }}js/vendor/codemirror/lib/codemirror.css?v={{ pma.version|url_encode }}">
<link rel="stylesheet" type="text/css" href="{{ header.base_dir }}js/vendor/codemirror/addon/hint/show-hint.css?v={{ pma.version|url_encode }}">
<link rel="stylesheet" type="text/css" href="{{ header.base_dir }}js/vendor/codemirror/addon/lint/lint.css?v={{ pma.version|url_encode }}">
<link rel="stylesheet" type="text/css" href="js/vendor/codemirror/lib/codemirror.css?v={{ pma.version|url_encode }}">
<link rel="stylesheet" type="text/css" href="js/vendor/codemirror/addon/hint/show-hint.css?v={{ pma.version|url_encode }}">
<link rel="stylesheet" type="text/css" href="js/vendor/codemirror/addon/lint/lint.css?v={{ pma.version|url_encode }}">
<link rel="stylesheet" type="text/css" href="{{ header.theme_path }}/css/theme{{ pma.text_dir == 'rtl' ? '.rtl' }}.css?v={{ pma.version|url_encode }}">
<title>{{ header.title }}</title>
{{ header.scripts|raw }}

View File

@ -1,6 +1,5 @@
{% for file in files %}
<script data-cfasync="false" src="{{ base_dir }}
{{- file.filename starts with 'index.php' ? file.filename : 'js/' ~ file.filename -}}
<script data-cfasync="false" src="{{ file.filename starts with 'index.php' ? file.filename : 'js/' ~ file.filename -}}
{{- '.php' in file.filename ? get_common(file.params|merge({'v': pma.version})) : '?v=' ~ pma.version|url_encode }}"></script>
{% endfor %}

View File

@ -572,11 +572,6 @@ class Config
$parts = array_slice($parts, 0, count($parts) - 1);
}
/* Remove extra path from javascript calls */
if (defined('PMA_PATH_TO_BASEDIR')) {
$parts = array_slice($parts, 0, count($parts) - 1);
}
// Add one more part to make the path end in slash unless it already ends with slash
if (count($parts) < 2 || $parts[array_key_last($parts)] !== '') {
$parts[] = '';

View File

@ -17,7 +17,6 @@ use PhpMyAdmin\Navigation\Navigation;
use PhpMyAdmin\Theme\ThemeManager;
use function array_merge;
use function defined;
use function htmlspecialchars;
use function ini_get;
use function json_encode;
@ -209,8 +208,6 @@ class Header
/** @return mixed[] */
public function getDisplay(): array
{
$baseDir = defined('PMA_PATH_TO_BASEDIR') ? PMA_PATH_TO_BASEDIR : '';
/** @var ThemeManager $themeManager */
$themeManager = ContainerBuilder::getContainer()->get(ThemeManager::class);
$theme = $themeManager->theme;
@ -278,7 +275,6 @@ class Header
return [
'lang' => Current::$lang,
'allow_third_party_framing' => $this->config->settings['AllowThirdPartyFraming'],
'base_dir' => $baseDir,
'theme_path' => $theme->getPath(),
'server' => Current::$server,
'title' => $this->getPageTitle(),

View File

@ -5,7 +5,6 @@ declare(strict_types=1);
namespace PhpMyAdmin;
use function array_key_exists;
use function defined;
use function md5;
use function str_contains;
@ -120,12 +119,6 @@ class Scripts
*/
public function getDisplay(): string
{
$baseDir = defined('PMA_PATH_TO_BASEDIR') ? PMA_PATH_TO_BASEDIR : '';
return $this->template->render('scripts', [
'base_dir' => $baseDir,
'files' => $this->files,
'code' => $this->code,
]);
return $this->template->render('scripts', ['files' => $this->files, 'code' => $this->code]);
}
}

View File

@ -23,10 +23,3 @@ if (! defined('TESTSUITE')) {
include_once ROOT_PATH . 'examples/signon-script.php';
require_once ROOT_PATH . 'app/constants.php';
require_once AUTOLOAD_FILE;
// phpcs:disable PSR1.Files.SideEffects
if (! defined('PMA_PATH_TO_BASEDIR')) {
define('PMA_PATH_TO_BASEDIR', '');
}
// phpcs:enable

View File

@ -90,7 +90,6 @@ class HeaderTest extends AbstractTestCase
$expected = [
'lang' => 'en',
'allow_third_party_framing' => false,
'base_dir' => '',
'theme_path' => '',
'server' => 0,
'title' => 'phpMyAdmin',

View File

@ -105,7 +105,6 @@ final class ResponseRendererTest extends AbstractTestCase
'header' => [
'lang' => 'en',
'allow_third_party_framing' => false,
'base_dir' => '',
'theme_path' => '',
'server' => 0,
'title' => 'phpMyAdmin',