From bd2140576bd7a61217398c2cbf9bfacc2464861d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Sun, 14 Jul 2024 01:21:55 -0300 Subject: [PATCH] Remove the PHPMYADMIN constant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This constant was used to avoid non-entry-points scripts being called directly. As phpMyAdmin has a public directory now, directly calling scripts outside public is not possible anymore. Introduced by afbb2a9dc2ff6f612e01f86e85788610e19a0338. Signed-off-by: MaurĂ­cio Meneghini Fauth --- app/constants.php | 4 ---- app/vendor_config.php | 4 ---- bin/console | 1 - public/index.php | 1 - public/setup/index.php | 1 - tests/bootstrap-dist.php | 2 -- tests/bootstrap-static.php | 4 ---- 7 files changed, 17 deletions(-) diff --git a/app/constants.php b/app/constants.php index 6f7dcbc3f0..c83c4afb65 100644 --- a/app/constants.php +++ b/app/constants.php @@ -2,10 +2,6 @@ declare(strict_types=1); -if (! defined('PHPMYADMIN')) { - exit; -} - $vendorConfig = require_once ROOT_PATH . 'app/vendor_config.php'; if ( ! is_array($vendorConfig) || ! isset( diff --git a/app/vendor_config.php b/app/vendor_config.php index d1889ba39e..49048be018 100644 --- a/app/vendor_config.php +++ b/app/vendor_config.php @@ -9,10 +9,6 @@ declare(strict_types=1); -if (! defined('PHPMYADMIN')) { - exit; -} - return [ /** * Path to vendor autoload file. Useful when you want to have vendor dependencies somewhere else. diff --git a/bin/console b/bin/console index eae5abc1db..b2855dc002 100755 --- a/bin/console +++ b/bin/console @@ -16,7 +16,6 @@ if (! defined('ROOT_PATH')) { define('ROOT_PATH', dirname(__DIR__) . DIRECTORY_SEPARATOR); } -define('PHPMYADMIN', true); require_once ROOT_PATH . 'app/constants.php'; require_once AUTOLOAD_FILE; diff --git a/public/index.php b/public/index.php index 73bd59eece..0103d2f891 100644 --- a/public/index.php +++ b/public/index.php @@ -9,7 +9,6 @@ if (! defined('ROOT_PATH')) { define('ROOT_PATH', dirname(__DIR__) . DIRECTORY_SEPARATOR); } -define('PHPMYADMIN', true); // phpcs:enable if (PHP_VERSION_ID < 80102) { diff --git a/public/setup/index.php b/public/setup/index.php index 6bf6116e37..b8aa6fd48c 100644 --- a/public/setup/index.php +++ b/public/setup/index.php @@ -9,7 +9,6 @@ if (! defined('ROOT_PATH')) { define('ROOT_PATH', dirname(__DIR__, 2) . DIRECTORY_SEPARATOR); } -define('PHPMYADMIN', true); // phpcs:enable if (PHP_VERSION_ID < 80102) { diff --git a/tests/bootstrap-dist.php b/tests/bootstrap-dist.php index 08fc07ab7d..ca06b4b40a 100644 --- a/tests/bootstrap-dist.php +++ b/tests/bootstrap-dist.php @@ -3,8 +3,6 @@ declare(strict_types=1); // phpcs:disable PSR1.Files.SideEffects - -define('PHPMYADMIN', true); define('TESTSUITE', true); if (! defined('ROOT_PATH')) { diff --git a/tests/bootstrap-static.php b/tests/bootstrap-static.php index 12df62c541..ef39642bab 100644 --- a/tests/bootstrap-static.php +++ b/tests/bootstrap-static.php @@ -14,10 +14,6 @@ if (! defined('ROOT_PATH')) { } // phpcs:disable PSR1.Files.SideEffects -if (! defined('PHPMYADMIN')) { - define('PHPMYADMIN', true); -} - if (! defined('TESTSUITE')) { define('TESTSUITE', true); }