Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurício Meneghini Fauth <mauricio@fauth.dev>2022-04-25 02:37:55 +0300
committerMaurício Meneghini Fauth <mauricio@fauth.dev>2022-04-25 02:37:55 +0300
commitb17700dd09cd1e420afee4287aea45efec533b6f (patch)
treea1d52f655df592b94997876b0177f8eba67fff72
parent8de823672671b30e16da90e224837f1a57af716b (diff)
Remove PMA_IS_WINDOWS constant
Gets the value from the Config class instead. Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
-rw-r--r--libraries/classes/Config.php1
-rw-r--r--libraries/classes/Controllers/Setup/HomeController.php2
-rw-r--r--phpstan-baseline.neon5
-rw-r--r--test/classes/ConfigTest.php1
-rw-r--r--test/classes/HeaderTest.php5
-rw-r--r--test/classes/MenuTest.php5
-rw-r--r--test/classes/Plugins/Import/ImportShpTest.php5
-rw-r--r--test/phpstan-constants.php1
8 files changed, 1 insertions, 24 deletions
diff --git a/libraries/classes/Config.php b/libraries/classes/Config.php
index ccf5cdcfda..6d43cea626 100644
--- a/libraries/classes/Config.php
+++ b/libraries/classes/Config.php
@@ -1028,7 +1028,6 @@ class Config
'PMA_MAJOR_VERSION',
'PMA_THEME_VERSION',
'PMA_THEME_GENERATION',
- 'PMA_IS_WINDOWS',
'PMA_IS_GD2',
'PMA_USR_OS',
'PMA_USR_BROWSER_VER',
diff --git a/libraries/classes/Controllers/Setup/HomeController.php b/libraries/classes/Controllers/Setup/HomeController.php
index 4c4c3ed005..d3f05047bf 100644
--- a/libraries/classes/Controllers/Setup/HomeController.php
+++ b/libraries/classes/Controllers/Setup/HomeController.php
@@ -152,7 +152,7 @@ class HomeController extends AbstractController
],
'values_escaped' => true,
];
- $eol = Core::ifSetOr($_SESSION['eol'], (PMA_IS_WINDOWS ? 'win' : 'unix'));
+ $eol = Core::ifSetOr($_SESSION['eol'], ($GLOBALS['PMA_Config']->get('PMA_IS_WINDOWS') ? 'win' : 'unix'));
$eolInput = $formDisplayTemplate->displayInput(
'eol',
__('End of line'),
diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon
index 601374c3e4..d078899cba 100644
--- a/phpstan-baseline.neon
+++ b/phpstan-baseline.neon
@@ -281,11 +281,6 @@ parameters:
path: libraries/classes/Controllers/Setup/HomeController.php
-
- message: "#^Ternary operator condition is always false\\.$#"
- count: 1
- path: libraries/classes/Controllers/Setup/HomeController.php
-
- -
message: "#^Comparison operation \"\\>\" between 0 and 0 is always false\\.$#"
count: 1
path: libraries/classes/Controllers/Table/ChangeController.php
diff --git a/test/classes/ConfigTest.php b/test/classes/ConfigTest.php
index a2ae82bf8e..b1ca1f1831 100644
--- a/test/classes/ConfigTest.php
+++ b/test/classes/ConfigTest.php
@@ -752,7 +752,6 @@ class ConfigTest extends AbstractTestCase
$defines = [
'PMA_VERSION',
'PMA_MAJOR_VERSION',
- 'PMA_IS_WINDOWS',
'PMA_IS_GD2',
'PMA_USR_OS',
'PMA_USR_BROWSER_VER',
diff --git a/test/classes/HeaderTest.php b/test/classes/HeaderTest.php
index bfa542eace..ca8b4f5225 100644
--- a/test/classes/HeaderTest.php
+++ b/test/classes/HeaderTest.php
@@ -7,8 +7,6 @@ namespace PhpMyAdmin\Tests;
use PhpMyAdmin\Core;
use PhpMyAdmin\Header;
use ReflectionProperty;
-use function define;
-use function defined;
/**
* @group medium
@@ -24,9 +22,6 @@ class HeaderTest extends AbstractTestCase
parent::defineVersionConstants();
parent::setTheme();
parent::setLanguage();
- if (! defined('PMA_IS_WINDOWS')) {
- define('PMA_IS_WINDOWS', false);
- }
$GLOBALS['server'] = 0;
$GLOBALS['message'] = 'phpmyadminmessage';
$GLOBALS['PMA_PHP_SELF'] = Core::getenv('PHP_SELF');
diff --git a/test/classes/MenuTest.php b/test/classes/MenuTest.php
index 1f98a948cb..bbf2d04cb8 100644
--- a/test/classes/MenuTest.php
+++ b/test/classes/MenuTest.php
@@ -6,8 +6,6 @@ namespace PhpMyAdmin\Tests;
use PhpMyAdmin\Core;
use PhpMyAdmin\Menu;
-use function define;
-use function defined;
class MenuTest extends AbstractTestCase
{
@@ -21,9 +19,6 @@ class MenuTest extends AbstractTestCase
parent::setTheme();
parent::loadDefaultConfig();
- if (! defined('PMA_IS_WINDOWS')) {
- define('PMA_IS_WINDOWS', false);
- }
$GLOBALS['cfg']['Server']['DisableIS'] = false;
$GLOBALS['server'] = 0;
$GLOBALS['cfg']['Server']['verbose'] = 'verbose host';
diff --git a/test/classes/Plugins/Import/ImportShpTest.php b/test/classes/Plugins/Import/ImportShpTest.php
index 074e1ceed0..c519c87bed 100644
--- a/test/classes/Plugins/Import/ImportShpTest.php
+++ b/test/classes/Plugins/Import/ImportShpTest.php
@@ -8,8 +8,6 @@ use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\File;
use PhpMyAdmin\Plugins\Import\ImportShp;
use PhpMyAdmin\Tests\AbstractTestCase;
-use function define;
-use function defined;
use function extension_loaded;
/**
@@ -30,9 +28,6 @@ class ImportShpTest extends AbstractTestCase
{
parent::setUp();
parent::loadDefaultConfig();
- if (! defined('PMA_IS_WINDOWS')) {
- define('PMA_IS_WINDOWS', false);
- }
$GLOBALS['server'] = 0;
//setting
$GLOBALS['plugin_param'] = 'table';
diff --git a/test/phpstan-constants.php b/test/phpstan-constants.php
index fba8e0cf36..fce4d74401 100644
--- a/test/phpstan-constants.php
+++ b/test/phpstan-constants.php
@@ -11,4 +11,3 @@ define('PROXY_PASS', '');
define('PMA_USR_BROWSER_AGENT', 'Other');
define('PMA_USR_BROWSER_VER', 1);
define('PMA_USR_OS', 'os');
-define('PMA_IS_WINDOWS', false);