Reorder conditional for CLI check, then URI comparison.

- Reordered the condition to first check for CLI mode before URI comparison.
This commit is contained in:
Jeroen De Meerleer 2024-06-03 23:41:42 +02:00
parent 24f1f6c974
commit 41f2ddea37
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6

View File

@ -2,7 +2,7 @@
require 'vendor/autoload.php'; require 'vendor/autoload.php';
require 'config.php'; require 'config.php';
if($_SERVER["REQUEST_URI"] == '/metrics' || php_sapi_name() == 'cli') { if(php_sapi_name() == 'cli' || $_SERVER["REQUEST_URI"] == '/metrics') {
header('Content-Type: text/plain; version=0.0.4'); header('Content-Type: text/plain; version=0.0.4');
foreach ($config as $key => &$c) { foreach ($config as $key => &$c) {
if(isset($c['command'])) { if(isset($c['command'])) {