Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




apache_mod_loaded [ WordPress Function ]

apache_mod_loaded ( $mod, $default = false )
Parameters:
  • (string) $mod e.g. mod_rewrite
  • (bool) $default The default return value if the module is not found
Returns:
  • (bool)
Defined at:



Does the specified module exist in the Apache config?

Source


<?php
function apache_mod_loaded($mod$default false) {
    global 
$is_apache;

    if ( !
$is_apache )
        return 
false;

    if ( 
function_exists('apache_get_modules') ) {
        
$mods apache_get_modules();
        if ( 
in_array($mod$mods) )
            return 
true;
    } elseif ( 
function_exists('phpinfo') ) {
            
ob_start();
            
phpinfo(8);
            
$phpinfo ob_get_clean();
            if ( 
false !== strpos($phpinfo$mod) )
                return 
true;
    }
    return 
$default;
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics