public function getRestartCommand($os, $distVersion = null)
    {

        // check if the restart command is registered
        if (array_key_exists($os, $this->restartCommands)) {
            // check whether or not we got an array, if so we have to check for the version
            $command = $this->restartCommands[$os];
            if (is_array($command)) {
                // if we do have a certain version we have to determine the command
                if (!is_null($distVersion)) {
                    // floor the dist version for comparison
                    $distVersion = (int) floor((float) $distVersion);
                    foreach ($command as $version => $potentialCommand) {
                        if ($distVersion === $version) {
                            $command = $potentialCommand;
                            break;
                        }
                    }
                }

                // if we did not find anything we have to take the default command
                if (is_array($command)) {
                    $command = $command['default'];
                }
            }

            // for Mac OS X the base directory has to be appended
            if ($os === DeploymentScanner::DARWIN) {
                $command = $this->getService()->realpath($command);
            }

            // return the command
            return $command;
        }

        // throw an exception if the restart command is not available
        throw new \Exception("Can't find restart command for OS $os");
    }
public function getRestartCommand($os, $distVersion = null)
    {

        // check if the restart command is registered
        if (array_key_exists($os, $this->restartCommands)) {
            // check whether or not we got an array, if so we have to check for the version
            $command = $this->restartCommands[$os];
            if (is_array($command)) {
                // if we do have a certain version we have to determine the command
                if (!is_null($distVersion)) {
                    // floor the dist version for comparison
                    $distVersion = (int) floor((float) $distVersion);
                    foreach ($command as $version => $potentialCommand) {
                        if ($distVersion === $version) {
                            $command = $potentialCommand;
                            break;
                        }
                    }
                }

                // if we did not find anything we have to take the default command
                if (is_array($command)) {
                    $command = $command['default'];
                }
            }

            // for Mac OS X the base directory has to be appended
            if ($os === DeploymentScanner::DARWIN) {
                $command = $this->getService()->realpath($command);
            }

            // return the command
            return $command;
        }

        // throw an exception if the restart command is not available
        throw new \Exception("Can't find restart command for OS $os");
    }
public function getRestartCommand ( $ os , $ distVersion = null ) { // check if the restart command is registered if ( array_key_exists ( $ os , $ this -> restartCommands ) ) { // check whether or not we got an array, if so we have to check for the version $ command = $ this -> restartCommands [ $ os ] ; if ( is_array ( $ command ) ) { // if we do have a certain version we have to determine the command if ( ! is_null ( $ distVersion ) ) { // floor the dist version for comparison $ distVersion = ( int ) floor ( ( float ) $ distVersion ) ; foreach ( $ command as $ version => $ potentialCommand ) { if ( $ distVersion === $ version ) { $ command = $ potentialCommand ; break ; } } } // if we did not find anything we have to take the default command if ( is_array ( $ command ) ) { $ command = $ command [ 'default' ] ; } } // for Mac OS X the base directory has to be appended if ( $ os === DeploymentScanner :: DARWIN ) { $ command = $ this -> getService ( ) -> realpath ( $ command ) ; } // return the command return $ command ; } // throw an exception if the restart command is not available throw new \ Exception ( "Can't find restart command for OS $os" ) ; }
Returns the restart command for the passed OS
if available.

@param string      $os          The OS to return the restart command for
@param string|null $distVersion Version of the operating system to get the restart command for

@return string The restart command
@throws \Exception Is thrown if the restart command for the passed OS is can't found
Returns the restart command for the passed OS if available .