Update URI check to include CLI request detection.
The code now checks if the request URI is '/metrics' or if the PHP script is running from the command line interface (CLI). This change allows for proper handling of CLI requests in addition to web requests.
This commit is contained in:
parent
7c61ead8ac
commit
66933d7d19
@ -2,7 +2,7 @@
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
require 'config.php';
|
require 'config.php';
|
||||||
|
|
||||||
if($_SERVER["REQUEST_URI"] == '/metrics') {
|
if($_SERVER["REQUEST_URI"] == '/metrics' || php_sapi_name() == 'cli') {
|
||||||
foreach ($config as $key => &$c) {
|
foreach ($config as $key => &$c) {
|
||||||
if(isset($c['command'])) {
|
if(isset($c['command'])) {
|
||||||
$output=null;
|
$output=null;
|
||||||
|
Loading…
Reference in New Issue
Block a user