apache_mod_loaded
Does the specified module exist in the Apache config?.
Description
Parameters (2)
- 0. $mod (string)
- E.g. mod_rewrite
- 1. $default — Optional. (constant) =>
false
- The default return value if the module is not found
Usage
if ( !function_exists( 'apache_mod_loaded' ) ) { require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/backpress/functions.core.php'; } // e.g. mod_rewrite $mod = ''; // The default return value if the module is not found $default = false; // NOTICE! Understand what this does before running. $result = apache_mod_loaded($mod, $default);
Defined (1)
The function is defined in the following location(s).
- /bp-forums/bbpress/bb-includes/backpress/functions.core.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;
- }