ShellServer

The shell server.<p/>

A shell server is associated with a collection of : the @see \io\vertx\jphp\ext\shell\ShellServer::registerTermServer method registers a term server. Term servers life cycle are managed by this server.

When a receives an incoming connection, a instance is created and associated with this connection.

The @see \io\vertx\jphp\ext\shell\ShellServer::createShell method can be used to create instance for testing purposes.

package

Default

Methods

__construct

__construct() 

Close the shell server, this is an asynchronous close.

close( $arg0 = null) : void

close()

Close the shell server, this is an asynchronous close.

param $completionHandler [callable] handler for getting notified when service is stopped close($completionHandler)

Arguments

$arg0

callable

Create a new shell server with specific options.

create( $arg0,  $arg1 = null) : \io\vertx\jphp\ext\shell\ShellServer
static

param $vertx [Vertx] the vertx create($vertx)

Create a new shell server with default options.

param $vertx [Vertx] the vertx param $options [ShellServerOptions | array] the options create($vertx, $options)

Arguments

$arg0

Vertx

$arg1

array | ShellServerOptions

Response

\io\vertx\jphp\ext\shell\ShellServer

the created shell server

Create a new shell, the returned shell should be closed explicitely.

createShell( $arg0 = null) : \io\vertx\jphp\ext\shell\Shell

createShell()

Create a new shell, the returned shell should be closed explicitely.

param $term [Term] the shell associated terminal createShell($term)

Arguments

$arg0

Term

Response

\io\vertx\jphp\ext\shell\Shell

the created shell

Start the shell service, this is an asynchronous start.

listen( $arg0 = null) : $this

listen()

Start the shell service, this is an asynchronous start.

param $listenHandler [callable] handler for getting notified when service is started listen($listenHandler)

Arguments

$arg0

callable

Response

$this

Register a command resolver for this server.

registerCommandResolver( $arg0) : $this

Arguments

$arg0

CommandResolver

Response

$this

a reference to this, so the API can be used fluently

Register a term server to this shell server, the term server lifecycle methods are managed by this shell server.

registerTermServer( $arg0) : $this

Arguments

$arg0

TermServer

Response

$this

a reference to this, so the API can be used fluently

Called when a new shell is created. Can be used to prepopulate the shell session with objects or set the prompt.

shellHandler( $arg0) : void

Arguments

$arg0

callable