PHP 클래스 Phergie_Hostmask, phergie

저자: Phergie Development Team ([email protected])
파일 보기 프로젝트 열기: phergie/phergie 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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