File: //usr/local/cwaf/web/directadmin/admin/conf/getconf.php
<?php
class CWAF_Conf
{
private $conf;
public function __construct() {
if (file_exists('/etc/cwaf/main.conf')) {
$conf = file_get_contents('/etc/cwaf/main.conf');
$lines = explode("\n", $conf);
foreach($lines as $line) {
if (strpos($line, '#') !== 0) {
$parts = explode("=", $line);
if(! empty($parts[0])) {
$this->conf[$parts[0]] = str_replace(array("\n", '"'), '', $parts[1]);
}
}
}
}
}
public function getConf()
{
return $this->conf;
}
public function getPath()
{
return $this->conf['cwaf_path'];
}
}