private function createExtensionHint() { $paths = IniHelper::getAll(); if (count($paths) === 1 && empty($paths[0])) { return ''; } $text = "\n To enable extensions, verify that they are enabled in your .ini files:\n - "; $text .= implode("\n - ", $paths); $text .= "\n You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode."; return $text; }
public function testWithoutLoadedIni() { $paths = array( '', 'one.ini', 'two.ini', ); $this->setEnv($paths); $this->assertContains('does not exist', IniHelper::getMessage()); $this->assertEquals($paths, IniHelper::getAll()); }
/** * Returns true if everything was written for the restart * * If any of the following fails (however unlikely) we must return false to * stop potential recursion: * - tmp ini file creation * - environment variable creation * * @param null|string $command The command to run, set by method * * @return bool */ private function prepareRestart(&$command) { $this->tmpIni = ''; $iniPaths = IniHelper::getAll(); $files = $this->getWorkingSet($iniPaths, $replace); if ($this->writeTmpIni($files, $replace)) { $command = $this->getCommand(); return $this->setEnvironment($iniPaths); } return false; }