Property | Type | Description | |
---|---|---|---|
$host | string | Host | |
$nick | string | Nick | |
$regex | string | Regular expression used to parse a hostmask | |
$username | string | Username |
Method | Description | |
---|---|---|
__construct ( string $nick, string $username, string $host ) : void | Constructor to initialize components of the hostmask. | |
__toString ( ) : string | Returns the hostmask for the originating server or user. | |
fromString ( string $hostmask ) : Phergie_Hostmask | Parses a string containing the entire hostmask into a new instance of this class. | |
getHost ( ) : string | Returns the hostname. | |
getNick ( ) : string | Returns the nick of the user. | |
getUsername ( ) : string | Returns the username of the user. | |
isValid ( string $string ) : boolean | Returns whether a given string appears to be a valid hostmask. | |
matches ( string $pattern, string $hostmask = null ) : boolean | Returns whether a given hostmask matches a given pattern. | |
setHost ( string $host ) : Phergie_Hostmask | Sets the hostname. | |
setNick ( string $nick ) : Phergie_Hostmask | Sets the nick of the user. | |
setUsername ( string $username ) : Phergie_Hostmask | Sets the username of the user. |
public __toString ( ) : string | ||
return | string |
public static fromString ( string $hostmask ) : Phergie_Hostmask | ||
$hostmask | string | Entire hostmask including the nick, username, and host components |
return | Phergie_Hostmask | New instance populated with data parsed from the provided hostmask string |
public getUsername ( ) : string | ||
return | string |
public matches ( string $pattern, string $hostmask = null ) : boolean | ||
$pattern | string | Pattern using conventions of a ban mask where represents a wildcard |
$hostmask | string | Optional hostmask to match against, if not the current hostmask instance |
return | boolean | TRUE if the hostmask matches the pattern, FALSE otherwise |
public setUsername ( string $username ) : Phergie_Hostmask | ||
$username | string | Username |
return | Phergie_Hostmask | Provides a fluent interface |
protected static string $regex | ||
return | string |