PHP Класс Phergie_Hostmask, phergie

Автор: Phergie Development Team ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$host string Host
$nick string Nick
$regex string Regular expression used to parse a hostmask
$username string Username

Открытые методы

Метод Описание
__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.

Описание методов

__construct() публичный Метод

Constructor to initialize components of the hostmask.
public __construct ( string $nick, string $username, string $host ) : void
$nick string Nick component
$username string Username component
$host string Host component
Результат void

__toString() публичный Метод

Returns the hostmask for the originating server or user.
public __toString ( ) : string
Результат string

fromString() публичный статический Метод

Parses a string containing the entire hostmask into a new instance of this class.
public static fromString ( string $hostmask ) : Phergie_Hostmask
$hostmask string Entire hostmask including the nick, username, and host components
Результат Phergie_Hostmask New instance populated with data parsed from the provided hostmask string

getHost() публичный Метод

Returns the hostname.
public getHost ( ) : string
Результат string

getNick() публичный Метод

Returns the nick of the user.
public getNick ( ) : string
Результат string

getUsername() публичный Метод

Returns the username of the user.
public getUsername ( ) : string
Результат string

isValid() публичный статический Метод

Returns whether a given string appears to be a valid hostmask.
public static isValid ( string $string ) : boolean
$string string Alleged hostmask string
Результат boolean TRUE if the string appears to be a valid hostmask, FALSE otherwise

matches() публичный Метод

Returns whether a given hostmask matches a given pattern.
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
Результат boolean TRUE if the hostmask matches the pattern, FALSE otherwise

setHost() публичный Метод

Sets the hostname.
public setHost ( string $host ) : Phergie_Hostmask
$host string Hostname
Результат Phergie_Hostmask Provides a fluent interface

setNick() публичный Метод

Sets the nick of the user.
public setNick ( string $nick ) : Phergie_Hostmask
$nick string User nick
Результат Phergie_Hostmask Provides a fluent interface

setUsername() публичный Метод

Sets the username of the user.
public setUsername ( string $username ) : Phergie_Hostmask
$username string Username
Результат Phergie_Hostmask Provides a fluent interface

Описание свойств

$host защищенное свойство

Host
protected string $host
Результат string

$nick защищенное свойство

Nick
protected string $nick
Результат string

$regex защищенное статическое свойство

Regular expression used to parse a hostmask
protected static string $regex
Результат string

$username защищенное свойство

Username
protected string $username
Результат string