IMuSession
require_once IMu::$lib . '/Session.php';
Since: 1.0
Description
Manages a connection to an IMu server.
The server’s host name and port can be specified by setting properties on the object or by setting class-based default properties.
Examples
- Connect to a default server.
$session = new IMuSession();
$session->connect();
Class Properties
Property |
Details |
---|---|
The default host to connect to if no object-specific host has been supplied. Type: string Getter: string getDefaultHost() Setter: setDefaultHost(string $value) |
|
The number of the port used to create a connection if no object-specific host has been supplied. Type: int Getter: int getDefaultPort() Setter: setDefaultPort(int $value) |
|
|
The default timeout value (in seconds). This timeout is used if the constructor is called without a timeout argument. Type: int Getter: int getDefaultTimeout() Setter: setDefaultTimeout(int $value) |
Constructors
Constructor |
Details |
||||||
---|---|---|---|---|---|---|---|
|
__construct([string $host = null [, string $port = null [, int $timeout = null]]]) Creates a Session object with the specified Parameters:
|
Properties
Property |
Details |
---|---|
|
A flag controlling whether the connection to the server should be closed after the next request. This flag is passed to the server as part of the next request to allow it to clean up. Type: bool Getter: bool getClose() Setter: setClose(bool $value) |
|
The unique identifier assigned by the server to the current session. Type: string Getter: string getContext() Setter: setContext(string $value) |
|
The name of the host used to create the connection. Setting this property after the connection has been established has no effect. Type: string Getter: string getHost() Setter: setHost(string $value) |
|
The number of the port used to create the connection. Setting this property after the connection has been established has no effect. Type: int Getter: int getPort() Setter: setPort(int $value) |
|
A flag controlling whether the server process handling this session should begin listening on a distinct, process-specific port to ensure a new session connects to the same server process. This is part of IMu's mechanism for maintaining state. If this flag is set
to Type: bool Getter: bool getSuspend() Setter: setSuspend(bool $value) |
|
Type: int Getter: int getTimeout() Setter: setTimeout(int $value) |
Methods
Method |
Details |
||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
connect() Opens a connection to an IMu server. Returns: Throws:
|
||||||||||
|
disconnect() Closes the connection to the IMu server. Returns: |
||||||||||
|
login(string $login [, string $password = null [, bool $spawn = true]]) Logs in as the given user with the given password. If the Parameters:
Returns: Throws:
|
||||||||||
|
logout() Logs the user out of the server. Returns: |
||||||||||
|
array request(array $request) Submits a low-level request to the IMu server. Parameters:
Returns:
Throws:
|