note 129173 added to function.apache-get-modules

From: Date: Thu, 18 Jan 2024 14:51:44 +0000
Subject: note 129173 added to function.apache-get-modules
Groups: php.notes 
Request: Send a blank email to php-notes+get-221127@lists.php.net to get a copy of this message
/** * Check if a Apache module is loaded (even if php run as fcgi or cgi ) * * @param string $module * @return bool */ public static function apache_check_module(string $module): bool { $module = ($module ? strval(value: $module) : ''); if (function_exists('apache_get_modules') && !empty($module)) { if (in_array(needle: $module, haystack: apache_get_modules())) { return TRUE; } } else if (!empty(shell_exec(command: 'apache2ctl -M | grep \'' . $module . '\''))) { return TRUE; } else { return FALSE; } } ---- Server IP: 45.112.84.4 Probable Submitter: 45.91.157.134 (proxied: 217.244.9.139) ---- Manual Page -- https://php.net/manual/en/function.apache-get-modules.php Edit -- https://main.php.net/note/edit/129173 Del: integrated -- https://main.php.net/note/delete/129173/integrated Del: useless -- https://main.php.net/note/delete/129173/useless Del: bad code -- https://main.php.net/note/delete/129173/bad+code Del: spam -- https://main.php.net/note/delete/129173/spam Del: non-english -- https://main.php.net/note/delete/129173/non-english Del: in docs -- https://main.php.net/note/delete/129173/in+docs Del: other reasons-- https://main.php.net/note/delete/129173 Reject -- https://main.php.net/note/reject/129173 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#221127) next »