PHP Class Phergie_Connection, phergie

Author: Phergie Development Team ([email protected])
ファイルを表示 Open project: phergie/phergie Class Usage Examples

Protected Properties

Property Type Description
$context array Stream context options
$encoding string Encoding method for the connection, defaults to ISO-8859-1 but can be set to UTF-8 if necessary
$host string Host to which the client will connect
$hostmask Phergie_Hostmask Hostmask for the connection
$nick string Nick that the client will use
$password string Password that the client will use
$port integer Port on which the client will connect, defaults to the standard IRC port
$realname string Realname that the client will use
$transport string Transport for the connection, defaults to tcp but can be set to ssl or variations thereof to connect over SSL
$username string Username that the client will use

Public Methods

Method Description
__construct ( array $options = [] ) : void Constructor to initialize instance properties.
getContext ( ) : array Returns the stream context options in use.
getEncoding ( ) : string Returns the encoding in use by the connection.
getHost ( ) : string Returns the host to which the client will connect if it is set or emits an error if it is not set.
getHostmask ( ) : string Returns a hostmask that uniquely identifies the connection.
getNick ( ) : string Returns the nick that the client will use.
getPassword ( ) : string Returns the password that the client will use.
getPort ( ) : integer Returns the port on which the client will connect.
getRealname ( ) : string Returns the realname that the client will use.
getTransport ( ) : string Returns the transport in use by the connection.
getUsername ( ) : string Returns the username that the client will use.
setContext ( array $context ) : Phergie_Connection_Streams Sets the stream context options to use.
setEncoding ( string $encoding ) : Phergie_Connection Sets the encoding for the connection to use.
setHost ( string $host ) : Phergie_Connection Sets the host to which the client will connect.
setNick ( string $nick ) : Phergie_Connection Sets the nick that the client will use.
setOptions ( array $options ) : Phergie_Connection Sets multiple connection settings using an array.
setPassword ( string $password ) : Phergie_Connection Sets the password that the client will use.
setPort ( integer $port ) : Phergie_Connection Sets the port on which the client will connect.
setRealname ( string $realname ) : Phergie_Connection Sets the realname that the client will use.
setTransport ( string $transport ) : Phergie_Connection Sets the transport for the connection to use.
setUsername ( string $username ) : Phergie_Connection Sets the username that the client will use.

Protected Methods

Method Description
checkSetting ( string $setting ) : void Emits an error related to a required connection setting does not have value set for it.

Method Details

__construct() public method

Constructor to initialize instance properties.
public __construct ( array $options = [] ) : void
$options array Optional associative array of property values to initialize
return void

checkSetting() protected method

Emits an error related to a required connection setting does not have value set for it.
protected checkSetting ( string $setting ) : void
$setting string Name of the setting
return void

getContext() public method

Returns the stream context options in use.
public getContext ( ) : array
return array Context options as they will be passed to stream_context_create()

getEncoding() public method

Returns the encoding in use by the connection.
public getEncoding ( ) : string
return string Encoding (ex: ASCII, ISO-8859-1, UTF-8, etc.)

getHost() public method

Returns the host to which the client will connect if it is set or emits an error if it is not set.
public getHost ( ) : string
return string

getHostmask() public method

Returns a hostmask that uniquely identifies the connection.
public getHostmask ( ) : string
return string

getNick() public method

Returns the nick that the client will use.
public getNick ( ) : string
return string

getPassword() public method

Returns the password that the client will use.
public getPassword ( ) : string
return string

getPort() public method

Returns the port on which the client will connect.
public getPort ( ) : integer
return integer

getRealname() public method

Returns the realname that the client will use.
public getRealname ( ) : string
return string

getTransport() public method

Returns the transport in use by the connection.
public getTransport ( ) : string
return string Transport (ex: tcp, ssl, etc.)

getUsername() public method

Returns the username that the client will use.
public getUsername ( ) : string
return string

setContext() public method

Sets the stream context options to use.
public setContext ( array $context ) : Phergie_Connection_Streams
$context array Context options as they will be passed to stream_context_create()
return Phergie_Connection_Streams Implements a fluent interface

setEncoding() public method

Sets the encoding for the connection to use.
public setEncoding ( string $encoding ) : Phergie_Connection
$encoding string Encoding to use (ex: ASCII, ISO-8859-1, UTF-8, etc.)
return Phergie_Connection Provides a fluent interface

setHost() public method

Sets the host to which the client will connect.
public setHost ( string $host ) : Phergie_Connection
$host string Hostname
return Phergie_Connection Provides a fluent interface

setNick() public method

Sets the nick that the client will use.
public setNick ( string $nick ) : Phergie_Connection
$nick string Nickname
return Phergie_Connection Provides a fluent interface

setOptions() public method

Sets multiple connection settings using an array.
public setOptions ( array $options ) : Phergie_Connection
$options array Associative array of setting names mapped to corresponding values
return Phergie_Connection Provides a fluent interface

setPassword() public method

Sets the password that the client will use.
public setPassword ( string $password ) : Phergie_Connection
$password string Password
return Phergie_Connection Provides a fluent interface

setPort() public method

Sets the port on which the client will connect.
public setPort ( integer $port ) : Phergie_Connection
$port integer Port
return Phergie_Connection Provides a fluent interface

setRealname() public method

Sets the realname that the client will use.
public setRealname ( string $realname ) : Phergie_Connection
$realname string Real name
return Phergie_Connection Provides a fluent interface

setTransport() public method

Sets the transport for the connection to use.
public setTransport ( string $transport ) : Phergie_Connection
$transport string Transport (ex: tcp, ssl, etc.)
return Phergie_Connection Provides a fluent interface

setUsername() public method

Sets the username that the client will use.
public setUsername ( string $username ) : Phergie_Connection
$username string Username
return Phergie_Connection Provides a fluent interface

Property Details

$context protected_oe property

Stream context options
protected array $context
return array

$encoding protected_oe property

Encoding method for the connection, defaults to ISO-8859-1 but can be set to UTF-8 if necessary
protected string $encoding
return string

$host protected_oe property

Host to which the client will connect
protected string $host
return string

$hostmask protected_oe property

Hostmask for the connection
protected Phergie_Hostmask $hostmask
return Phergie_Hostmask

$nick protected_oe property

Nick that the client will use
protected string $nick
return string

$password protected_oe property

Password that the client will use
protected string $password
return string

$port protected_oe property

Port on which the client will connect, defaults to the standard IRC port
protected int $port
return integer

$realname protected_oe property

Realname that the client will use
protected string $realname
return string

$transport protected_oe property

Transport for the connection, defaults to tcp but can be set to ssl or variations thereof to connect over SSL
protected string $transport
return string

$username protected_oe property

Username that the client will use
protected string $username
return string