protected function _listIniFiles() { $bin = \Helper\System::getPHPCommand(); $filelist = `{$bin} -r 'echo php_ini_scanned_files();'`; if (strpos($filelist, ',')) { $files = explode(',', $filelist); foreach ($files as $file) { echo trim($file) . PHP_EOL; } } return false; }
/** * Look up the value for the given ini directive * in the currently active PHP version. * * @param $key * @return bool */ public static function getPHPConfig($key) { $bin = \Helper\System::getPHPCommand(); // Special case: since we explicitly disable xdebug.profiler_enable on CLI commands // we need to omit this when looking up this specific key. // Otherwise the result will always be 0 if ($key == 'xdebug.profiler_enable') { $bin = str_replace('-d xdebug.profiler_enable=Off', '', $bin); } $current = `{$bin} -r "\\\$value = ini_get('{$key}'); echo \\\$value === false ? 'unknown-directive' : \\\$value;"`; if ($current == 'unknown-directive') { return false; } return $current; }