public function getInfo($token, $info, $args = array())
    {
        if ($token instanceof \Erebot\Module\IrcTracker\Token) {
            $methods = array(
                self::INFO_ISON     => 'isOn',
                self::INFO_MASK     => 'getMask',
                self::INFO_NICK     => 'getNick',
                self::INFO_IDENT    => 'getIdent',
                self::INFO_HOST     => 'getHost',
            );
            if (!isset($methods[$info])) {
                throw new \Erebot\InvalidValueException('No such information');
            }
            array_unshift($args, $token, $methods[$info]);
            return call_user_func($args);
        }

        $fmt = $this->getFormatter(null);
        if (is_string($token)) {
            $collator   = $this->connection->getCollator();
            $token      = $collator->normalizeNick(
                self::extractNick($token)
            );
            $token = array_search($token, $this->nicks);
            if ($token === false) {
                throw new \Erebot\NotFoundException(
                    $fmt->_('No such user')
                );
            }
        }

        if (!isset($this->ial[$token])) {
            throw new \Erebot\NotFoundException($fmt->_('No such token'));
        }

        $info = strtolower($info);
        if ($info == 'mask') {
            if ($this->ial[$token]['ident'] === null) {
                return $this->ial[$token]['nick'].'!*@*';
            }
            return  $this->ial[$token]['nick'].'!'.
                    $this->ial[$token]['ident'].'@'.
                    $this->ial[$token]['host'];
        }

        if (!array_key_exists($info, $this->ial[$token])) {
            throw new \Erebot\InvalidValueException(
                $fmt->_('No such information')
            );
        }
        return $this->ial[$token][$info];
    }
public function getInfo($token, $info, $args = array())
    {
        if ($token instanceof \Erebot\Module\IrcTracker\Token) {
            $methods = array(
                self::INFO_ISON     => 'isOn',
                self::INFO_MASK     => 'getMask',
                self::INFO_NICK     => 'getNick',
                self::INFO_IDENT    => 'getIdent',
                self::INFO_HOST     => 'getHost',
            );
            if (!isset($methods[$info])) {
                throw new \Erebot\InvalidValueException('No such information');
            }
            array_unshift($args, $token, $methods[$info]);
            return call_user_func($args);
        }

        $fmt = $this->getFormatter(null);
        if (is_string($token)) {
            $collator   = $this->connection->getCollator();
            $token      = $collator->normalizeNick(
                self::extractNick($token)
            );
            $token = array_search($token, $this->nicks);
            if ($token === false) {
                throw new \Erebot\NotFoundException(
                    $fmt->_('No such user')
                );
            }
        }

        if (!isset($this->ial[$token])) {
            throw new \Erebot\NotFoundException($fmt->_('No such token'));
        }

        $info = strtolower($info);
        if ($info == 'mask') {
            if ($this->ial[$token]['ident'] === null) {
                return $this->ial[$token]['nick'].'!*@*';
            }
            return  $this->ial[$token]['nick'].'!'.
                    $this->ial[$token]['ident'].'@'.
                    $this->ial[$token]['host'];
        }

        if (!array_key_exists($info, $this->ial[$token])) {
            throw new \Erebot\InvalidValueException(
                $fmt->_('No such information')
            );
        }
        return $this->ial[$token][$info];
    }
public function getInfo ( $ token , $ info , $ args = array ( ) ) { if ( $ token instanceof \ Erebot \ Module \ IrcTracker \ Token ) { $ methods = array ( self :: INFO_ISON => 'isOn' , self :: INFO_MASK => 'getMask' , self :: INFO_NICK => 'getNick' , self :: INFO_IDENT => 'getIdent' , self :: INFO_HOST => 'getHost' , ) ; if ( ! isset ( $ methods [ $ info ] ) ) { throw new \ Erebot \ InvalidValueException ( 'No such information' ) ; } array_unshift ( $ args , $ token , $ methods [ $ info ] ) ; return call_user_func ( $ args ) ; } $ fmt = $ this -> getFormatter ( null ) ; if ( is_string ( $ token ) ) { $ collator = $ this -> connection -> getCollator ( ) ; $ token = $ collator -> normalizeNick ( self :: extractNick ( $ token ) ) ; $ token = array_search ( $ token , $ this -> nicks ) ; if ( $ token === false ) { throw new \ Erebot \ NotFoundException ( $ fmt -> _ ( 'No such user' ) ) ; } } if ( ! isset ( $ this -> ial [ $ token ] ) ) { throw new \ Erebot \ NotFoundException ( $ fmt -> _ ( 'No such token' ) ) ; } $ info = strtolower ( $ info ) ; if ( $ info == 'mask' ) { if ( $ this -> ial [ $ token ] [ 'ident' ] === null ) { return $ this -> ial [ $ token ] [ 'nick' ] . '!*@*' ; } return $ this -> ial [ $ token ] [ 'nick' ] . '!' . $ this -> ial [ $ token ] [ 'ident' ] . '@' . $ this -> ial [ $ token ] [ 'host' ] ; } if ( ! array_key_exists ( $ info , $ this -> ial [ $ token ] ) ) { throw new \ Erebot \ InvalidValueException ( $ fmt -> _ ( 'No such information' ) ) ; } return $ this -> ial [ $ token ] [ $ info ] ; }
Returns information about some user given a token
associated with that user.

\param opaque $token
Token associated with the user.

\param opaque $info
The type of information we're interested in.
This is one of the INFO_* constants provided
by this class.

\param array $args
(optional) Additional arguments for the query.
Defaults to an empty array. At present time,
this argument is only useful when you pass
one of Erebot::Module::IrcTracker::INFO_HOST or
Erebot::Module::IrcTracker::INFO_MASK as the
value for $info. In this case, you may pass an
array containing a boolean ($canonical) indicating
the type of hostname canonicalization to apply.
See also Erebot::Interfaces::Identity::getHost()
for more information on the $canonical parameter.

\retval mixed
Requested information about that user.
This may be \b null if the requested information
has not been obtained yet.

\throw Erebot::InvalidValueException
The value for $info is invalid.

\throw Erebot::NotFoundException
The given $token does not match any known user.

\warning
This method is not meant to be called directly.
Instead, you should call the equivalent methods
(getNick(), getHost(), etc.) from the token
returned by Erebot::Module::IrcTracker::startTracking().
Returns information about some user given a token associated with that user .