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

mode() public method

Switch to the passed mode, which can either be 'dev', 'prod' or 'install'.
public mode ( React\Socket\ConnectionInterface $conn, string $mode ) : void
$conn React\Socket\ConnectionInterface The connection resource
$mode string The setup mode to switch to
return void
    public function mode(ConnectionInterface $conn, $mode)
    {
        // switch to the new runlevel
        $this->synchronized(function ($self, $newMode) {
            // wait till the previous commands has been finished
            while ($self->locked === true) {
                sleep(1);
            }
            // set the command name
            $self->command = ModeCommand::COMMAND;
            // lock process
            $self->locked = true;
            $self->params = $newMode;
            // notify the AS to execute the command
            $self->notify();
        }, $this, $mode);
    }