AppserverIo\Appserver\Core\ApplicationServer::runlevelFromString PHP Method

runlevelFromString() public method

Translates and returns the runlevel of the passed a string representation.
public runlevelFromString ( string $runlevel ) : integer
$runlevel string The string representation of the runlevel to return
return integer The runlevel of the passed string representation
    public function runlevelFromString($runlevel)
    {
        // query whether the passed string representation is a valid runlevel
        if (Runlevels::singleton()->isRunlevel($runlevel)) {
            return Runlevels::singleton()->getRunlevel($runlevel);
        }
        // throw an exception if the runlevel is unknown
        throw new \Exception(sprintf('Request invalid runlevel to string conversion for %s', $runlevel));
    }