コード例 #1
0
ファイル: AutoJoin.php プロジェクト: marmotz/wallirc
 public function onOpen(Bucket $bucket)
 {
     $nick = $this->getConfiguration()->get('connection.nick');
     foreach ($this->getConfiguration()->get('connection.channels') as $channel) {
         $bucket->getSource()->join($nick, $channel);
     }
 }
コード例 #2
0
ファイル: Commands.php プロジェクト: marmotz/wallirc
 public function onPrivateMessage(Bucket $bucket)
 {
     $data = $bucket->getData();
     $owner = $this->getConfiguration()->get('configuration.commands.owner');
     if ($owner && $data['from']['nick'] !== $owner) {
         return;
     }
     switch (trim($data['message'])) {
         case 'quit':
             die;
             break;
     }
 }
コード例 #3
0
ファイル: Debug.php プロジェクト: Grummfy/Central
 public static function receiveException(Core\Event\Bucket $bucket)
 {
     // Early draft.
     self::$_message = $bucket->getData()->raise();
     return;
 }
コード例 #4
0
ファイル: Logger.php プロジェクト: marmotz/wallirc
 public function onQuit(Bucket $bucket)
 {
     $data = $bucket->getData();
     $this->log(sprintf('%s quit IRC (%s)', $data['from']['nick'], $data['message']));
 }
コード例 #5
0
ファイル: Event.php プロジェクト: JoeHorn/Core
 /**
  * Send/fire a bucket to a listener.
  *
  * @param   string                  $listenerId    Listener ID.
  * @param   \Hoa\Core\Event\Bucket  $data          Data.
  * @return  array
  * @throws  \Hoa\Core\Exception
  */
 public function fire($listenerId, Bucket $data)
 {
     if (false === $this->listenerExists($listenerId)) {
         throw new Core\Exception('Cannot fire on %s because it is not defined.', 1);
     }
     $data->setSource($this->_source);
     $out = [];
     foreach ($this->_listen[$listenerId] as $callable) {
         $out[] = $callable($data);
     }
     return $out;
 }