for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is, guess what, part of WebHelper.
*
* (c) James <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace JamesRezo\WebHelper\WebServer;
use WebHelper\Parser\ApacheParser;
* ApacheWebServer is the webserver class for apache httpd webserver.
class ApacheWebServer extends WebServer
{
* Constructor.
* @param string $version the semver-like version of the apache webserver
public function __construct($version = '')
parent::__construct('apache', $version);
$this->parser = new ApacheParser();
parser
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
}
public function extractVersion($settings = '')
return $this->match('/^Server version: Apache\/([0-9\.]+) .*/', $settings);
public function extractRootConfigurationFile($settings = '')
return $this->match('/ -D SERVER_CONFIG_FILE="([^"]+)"/', $settings);
* Loads and cleans a config file.
* @param string $file a Configuration file
* @return array an array of the cleaned directives of a the config per entry
public function getActiveConfig($file = '')
return $this->parser->setConfigFile($file)->getActiveConfig();
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: