Created
June 24, 2013 10:10
-
-
Save Shagshag/5849077 to your computer and use it in GitHub Desktop.
return true if the module $name is activated in apache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* return true if the module $name is activated in apache | |
* | |
* @param string $name module name | |
* @return boolean | |
* @author Samdha | |
**/ | |
function detect_apache_mod($name) { | |
$save = ob_get_clean(); | |
ob_start(); | |
phpinfo(); | |
$phpinfo = ob_get_clean(); | |
if ($save !== false) { | |
ob_start(); | |
echo $save; | |
} | |
return (strpos($phpinfo, $name) !== false); | |
} | |
if (detect_apache_mod('mod_evasive')) sleep(1); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment