适用于PHP的Apache配置解析器 [英] Apache config parser for PHP

查看:135
本文介绍了适用于PHP的Apache配置解析器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一些PHP工具来解析与该Perl模块类似的Apache配置文件: http://metacpan.org/pod/Apache::ConfigParser

I am looking for some PHP utility that parses Apache configuration files similar to this Perl's module: http://metacpan.org/pod/Apache::ConfigParser

有任何线索吗?

推荐答案

PEAR :: Config 支持Apache样式的配置文件.
看看手册 http://pear .php.net/manual/en/package.configuration.config.avail-container.apache.php

PEAR::Config supports Apache-style config files.
Have a look at the manual http://pear.php.net/manual/en/package.configuration.config.avail-container.apache.php

$conf = new Config();
$root = $conf->parseConfig("/etc/apache2/httpd.conf", "apache");
print current($root->getItem('directive', 'Listen'))->content;

或者类似的东西.

这篇关于适用于PHP的Apache配置解析器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆