Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Runtime.php

function Runtime::getCurrentSettings

Parses the loaded php.ini file (if any) as well as all additional php.ini files from the additional ini dir for a list of all configuration settings loaded from files at startup. Then checks for each php.ini setting passed via the `$values` parameter whether this setting has been changed at runtime. Returns an array of strings where each string has the format `key=value` denoting the name of a changed php.ini setting with its new value.

Return value

string[]

File

vendor/sebastian/environment/src/Runtime.php, line 240

Class

Runtime

Namespace

SebastianBergmann\Environment

Code

public function getCurrentSettings(array $values) : array {
    $diff = [];
    $files = [];
    if ($file = php_ini_loaded_file()) {
        $files[] = $file;
    }
    if ($scanned = php_ini_scanned_files()) {
        $files = array_merge($files, array_map('trim', explode(",\n", $scanned)));
    }
    foreach ($files as $ini) {
        $config = parse_ini_file($ini, true);
        foreach ($values as $value) {
            $set = ini_get($value);
            if (empty($set)) {
                continue;
            }
            if (!isset($config[$value]) || $set !== $config[$value]) {
                $diff[$value] = sprintf('%s=%s', $value, $set);
            }
        }
    }
    return $diff;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal