You are here

public function PHPUnit_Util_Configuration::getPHPConfiguration in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/src/Util/Configuration.php \PHPUnit_Util_Configuration::getPHPConfiguration()

Returns the PHP configuration.

@since Method available since Release 3.2.1

Return value

array

1 call to PHPUnit_Util_Configuration::getPHPConfiguration()
PHPUnit_Util_Configuration::handlePHPConfiguration in vendor/phpunit/phpunit/src/Util/Configuration.php
Handles the PHP configuration.

File

vendor/phpunit/phpunit/src/Util/Configuration.php, line 427

Class

PHPUnit_Util_Configuration
Wrapper for the PHPUnit XML configuration file.

Code

public function getPHPConfiguration() {
  $result = array(
    'include_path' => array(),
    'ini' => array(),
    'const' => array(),
    'var' => array(),
    'env' => array(),
    'post' => array(),
    'get' => array(),
    'cookie' => array(),
    'server' => array(),
    'files' => array(),
    'request' => array(),
  );
  foreach ($this->xpath
    ->query('php/includePath') as $includePath) {
    $path = (string) $includePath->textContent;
    if ($path) {
      $result['include_path'][] = $this
        ->toAbsolutePath($path);
    }
  }
  foreach ($this->xpath
    ->query('php/ini') as $ini) {
    $name = (string) $ini
      ->getAttribute('name');
    $value = (string) $ini
      ->getAttribute('value');
    $result['ini'][$name] = $value;
  }
  foreach ($this->xpath
    ->query('php/const') as $const) {
    $name = (string) $const
      ->getAttribute('name');
    $value = (string) $const
      ->getAttribute('value');
    $result['const'][$name] = $this
      ->getBoolean($value, $value);
  }
  foreach (array(
    'var',
    'env',
    'post',
    'get',
    'cookie',
    'server',
    'files',
    'request',
  ) as $array) {
    foreach ($this->xpath
      ->query('php/' . $array) as $var) {
      $name = (string) $var
        ->getAttribute('name');
      $value = (string) $var
        ->getAttribute('value');
      $result[$array][$name] = $this
        ->getBoolean($value, $value);
    }
  }
  return $result;
}