src/Prompt.php
protected function handleMessage($line)
    {
        $pos = strpos($line, ' ');
        if ($pos === false) {
            return;
        }

        $pattern    = preg_quote(substr($line, 0, $pos), '@');
        $pattern    = strtr($pattern, array('\\?' => '.?', '\\*' => '.*'));
        $line       = substr($line, $pos + 1);
        if ($line === false) {
            return;
        }

        foreach ($this->bot->getConnections() as $connection) {
            if (!($connection instanceof \Erebot\Interfaces\SendingConnection) || $connection == $this) {
                continue;
            }

            $config = $connection->getConfig(null);
            $netConfig = $config->getNetworkCfg();
            if (preg_match('@^'.$pattern.'$@Di', $netConfig->getName())) {
                $connection->getIO()->push($line);
            }
        }
    }
protected function handleMessage($line)
    {
        $pos = strpos($line, ' ');
        if ($pos === false) {
            return;
        }

        $pattern    = preg_quote(substr($line, 0, $pos), '@');
        $pattern    = strtr($pattern, array('\\?' => '.?', '\\*' => '.*'));
        $line       = substr($line, $pos + 1);
        if ($line === false) {
            return;
        }

        foreach ($this->bot->getConnections() as $connection) {
            if (!($connection instanceof \Erebot\Interfaces\SendingConnection) || $connection == $this) {
                continue;
            }

            $config = $connection->getConfig(null);
            $netConfig = $config->getNetworkCfg();
            if (preg_match('@^'.$pattern.'$@Di', $netConfig->getName())) {
                $connection->getIO()->push($line);
            }
        }
    }
protected function handleMessage ( $ line ) { $ pos = strpos ( $ line , ' ' ) ; if ( $ pos === false ) { return ; } $ pattern = preg_quote ( substr ( $ line , 0 , $ pos ) , '@' ) ; $ pattern = strtr ( $ pattern , array ( '\\?' => '.?' , '\\*' => '.*' ) ) ; $ line = substr ( $ line , $ pos + 1 ) ; if ( $ line === false ) { return ; } foreach ( $ this -> bot -> getConnections ( ) as $ connection ) { if ( ! ( $ connection instanceof \ Erebot \ Interfaces \ SendingConnection ) || $ connection == $ this ) { continue ; } $ config = $ connection -> getConfig ( null ) ; $ netConfig = $ config -> getNetworkCfg ( ) ; if ( preg_match ( '@^' . $ pattern . '$@Di' , $ netConfig -> getName ( ) ) ) { $ connection -> getIO ( ) -> push ( $ line ) ; } } }
Handles a line received from the prompt.

\param string $line
A single line of text received from the prompt,
with the end-of-line sequence stripped.
Handles a line received from the prompt .