apache_mod_loaded( string $mod, bool $default = false )
Does the specified module exist in the Apache config?
描述
参数
- $mod
-
(string)
(Required)
The module, e.g. mod_rewrite. - $default
-
(bool)
(Optional)
The default return value if the module is not found.Default value: false
返回值
(bool) Whether the specified module is loaded.
源代码
File: wp-includes/functions.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' ) && false === strpos( ini_get( 'disable_functions' ), 'phpinfo' ) ) {
ob_start();
phpinfo(8);
$phpinfo = ob_get_clean();
if ( false !== strpos($phpinfo, $mod) )
return true;
}
return $default;
}
更新日志
Version | 描述 |
---|---|
2.5.0 | Introduced. |
相关函数
Used By
-
wp-admin/includes/network.php:
network_step1() -
wp-admin/includes/misc.php:
got_mod_rewrite()
User Contributed Notes
你可能对这些文章感兴趣:
- wordpress函数export_wp()用法示例
- wordpress函数extract_from_markers()用法示例
- wordpress函数export_add_js()用法示例
- wordpress函数export_date_options()用法示例
- wordpress函数esc_textarea()用法示例
- wordpress函数esc_url()用法示例
- wordpress函数esc_url_raw()用法示例
- wordpress函数esc_js()用法示例
- wordpress函数esc_sql()用法示例
- wordpress函数esc_html__()用法示例
- wordpress函数esc_html_x()用法示例
- wordpress函数esc_html()用法示例
- wordpress函数esc_html_e()用法示例
- wordpress函数esc_attr_x()用法示例
如有疑问,请前往问答中心反馈!
反馈