Phergie
[ class tree: Phergie ] [ index: Phergie ] [ all elements ]

Class: Phergie_Hostmask

Source Location: /Phergie/Hostmask.php

Class Overview


Data structure for a hostmask.


Author(s):

Variables

Methods



Class Details

[line 31]
Data structure for a hostmask.



Tags:

author:  Phergie Development Team <team@phergie.org>
link:  http://pear.phergie.org/package/Phergie
license:  New BSD License


[ Top ]


Class Variables

static $regex =  '/^([^!@]+)!(?:[ni]=)?([^@]+)@([^ ]+)/'

[line 59]

Regular expression used to parse a hostmask



Tags:

access:  protected

Type:   string


[ Top ]

$host =

[line 38]

Host



Tags:

access:  protected

Type:   string


[ Top ]

$nick =

[line 45]

Nick



Tags:

access:  protected

Type:   string


[ Top ]

$username =

[line 52]

Username



Tags:

access:  protected

Type:   string


[ Top ]



Class Methods


static method fromString [line 101]

static Phergie_Hostmask fromString( string $hostmask)

Parses a string containing the entire hostmask into a new instance of this class.



Tags:

return:  New instance populated with data parsed from the provided hostmask string
throws:  Phergie_Hostmask_Exception
access:  public


Parameters:

string   $hostmask   Entire hostmask including the nick, username, and host components

[ Top ]

static method isValid [line 85]

static bool isValid( string $string)

Returns whether a given string appears to be a valid hostmask.



Tags:

return:  TRUE if the string appears to be a valid hostmask, FALSE otherwise
access:  public


Parameters:

string   $string   Alleged hostmask string

[ Top ]

constructor __construct [line 70]

void __construct( string $nick, string $username, string $host)

Constructor to initialize components of the hostmask.



Tags:

access:  public


Parameters:

string   $nick   Nick component
string   $username   Username component
string   $host   Host component

[ Top ]

method getHost [line 133]

string getHost( )

Returns the hostname.



Tags:

access:  public


[ Top ]

method getNick [line 181]

string getNick( )

Returns the nick of the user.



Tags:

access:  public


[ Top ]

method getUsername [line 157]

string getUsername( )

Returns the username of the user.



Tags:

access:  public


[ Top ]

method matches [line 207]

bool matches( string $pattern, [string $hostmask = null])

Returns whether a given hostmask matches a given pattern.



Tags:

return:  TRUE if the hostmask matches the pattern, FALSE otherwise
link:  Examples
access:  public


Parameters:

string   $pattern   Pattern using conventions of a ban mask where represents a wildcard
string   $hostmask   Optional hostmask to match against, if not the current hostmask instance

[ Top ]

method setHost [line 121]

Phergie_Hostmask setHost( string $host)

Sets the hostname.



Tags:

return:  Provides a fluent interface
access:  public


Parameters:

string   $host   Hostname

[ Top ]

method setNick [line 169]

Phergie_Hostmask setNick( string $nick)

Sets the nick of the user.



Tags:

return:  Provides a fluent interface
access:  public


Parameters:

string   $nick   User nick

[ Top ]

method setUsername [line 145]

Phergie_Hostmask setUsername( string $username)

Sets the username of the user.



Tags:

return:  Provides a fluent interface
access:  public


Parameters:

string   $username   Username

[ Top ]

method __toString [line 191]

string __toString( )

Returns the hostmask for the originating server or user.



Tags:

access:  public


[ Top ]


Documentation generated on Mon, 27 Sep 2010 23:03:48 -0500 by phpDocumentor 1.4.3