private function prepareRestart()
    {
        $error = '';
        $iniFiles = self::getAllIniFiles();
        $scannedInis = count($iniFiles) > 1;
        $tmpDir = sys_get_temp_dir();

        if (!$this->cli) {
            $error = 'Unsupported SAPI: '.PHP_SAPI;
        } elseif (!defined('PHP_BINARY')) {
            $error = 'PHP version is too old: '.PHP_VERSION;
        } elseif (!$this->checkConfiguration($info)) {
            $error = $info;
        } elseif (!$this->checkScanDirConfig()) {
            $error = 'PHP version does not report scanned inis: '.PHP_VERSION;
        } elseif (!$this->checkMainScript()) {
            $error = 'Unable to access main script: '.$this->script;
        } elseif (!$this->writeTmpIni($iniFiles, $tmpDir, $error)) {
            $error = $error ?: 'Unable to create temp ini file at: '.$tmpDir;
        } elseif (!$this->setEnvironment($scannedInis, $iniFiles)) {
            $error = 'Unable to set environment variables';
        }

        if ($error) {
            $this->notify(Status::ERROR, $error);
        }

        return empty($error);
    }
private function prepareRestart()
    {
        $error = '';
        $iniFiles = self::getAllIniFiles();
        $scannedInis = count($iniFiles) > 1;
        $tmpDir = sys_get_temp_dir();

        if (!$this->cli) {
            $error = 'Unsupported SAPI: '.PHP_SAPI;
        } elseif (!defined('PHP_BINARY')) {
            $error = 'PHP version is too old: '.PHP_VERSION;
        } elseif (!$this->checkConfiguration($info)) {
            $error = $info;
        } elseif (!$this->checkScanDirConfig()) {
            $error = 'PHP version does not report scanned inis: '.PHP_VERSION;
        } elseif (!$this->checkMainScript()) {
            $error = 'Unable to access main script: '.$this->script;
        } elseif (!$this->writeTmpIni($iniFiles, $tmpDir, $error)) {
            $error = $error ?: 'Unable to create temp ini file at: '.$tmpDir;
        } elseif (!$this->setEnvironment($scannedInis, $iniFiles)) {
            $error = 'Unable to set environment variables';
        }

        if ($error) {
            $this->notify(Status::ERROR, $error);
        }

        return empty($error);
    }
private function prepareRestart ( ) { $ error = '' ; $ iniFiles = self :: getAllIniFiles ( ) ; $ scannedInis = count ( $ iniFiles ) > 1 ; $ tmpDir = sys_get_temp_dir ( ) ; if ( ! $ this -> cli ) { $ error = 'Unsupported SAPI: ' . PHP_SAPI ; } elseif ( ! defined ( 'PHP_BINARY' ) ) { $ error = 'PHP version is too old: ' . PHP_VERSION ; } elseif ( ! $ this -> checkConfiguration ( $ info ) ) { $ error = $ info ; } elseif ( ! $ this -> checkScanDirConfig ( ) ) { $ error = 'PHP version does not report scanned inis: ' . PHP_VERSION ; } elseif ( ! $ this -> checkMainScript ( ) ) { $ error = 'Unable to access main script: ' . $ this -> script ; } elseif ( ! $ this -> writeTmpIni ( $ iniFiles , $ tmpDir , $ error ) ) { $ error = $ error ? : 'Unable to create temp ini file at: ' . $ tmpDir ; } elseif ( ! $ this -> setEnvironment ( $ scannedInis , $ iniFiles ) ) { $ error = 'Unable to set environment variables' ; } if ( $ error ) { $ this -> notify ( Status :: ERROR , $ error ) ; } return empty ( $ error ) ; }
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

@return bool
Returns true if everything was written for the restart