Prevent warningx in get_classname

This commit is contained in:
markjcrane
2025-11-14 12:11:42 -07:00
parent 71edbd5b28
commit d5ef3a3834
2 changed files with 6 additions and 2 deletions

View File

@@ -39,9 +39,12 @@
//function to parse a FusionPBX service from a .service file
if (!function_exists('get_classname')) {
function get_classname(string $file) {
if (!file_exists($file)) {
return '';
}
$parsed = parse_ini_file($file);
$exec_cmd = $parsed['ExecStart'];
$parts = explode(' ', $exec_cmd);
$exec_cmd = $parsed['ExecStart'] ?? '';
$parts = explode(' ', $exec_cmd ?? '');
$php_file = $parts[1] ?? '';
if (!empty($php_file)) {
return $php_file;

View File

@@ -28,6 +28,7 @@ Con Portions created by the Initial Developer are Copyright (C) 2008-2025
//includes files
require_once dirname(__DIR__, 2) . "/resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (!permission_exists('system_view_info')
|| !permission_exists('system_view_cpu')