Exemplo n.º 1
0
 public function testRetrievesUniqueHubServerUrlsOnly()
 {
     $this->publisher->addHubUrls(array(
         'http://www.example.com/hub', 'http://www.example.com/hub2',
         'http://www.example.com/hub'
     ));
     $this->assertEquals(array(
         'http://www.example.com/hub', 'http://www.example.com/hub2'
     ), $this->publisher->getHubUrls());
 }
Exemplo n.º 2
0
 /**
  * Pubsubhubbub送信
  */
 protected function sendPubsubhubbub()
 {
     // Pubsubhubbub発行オブジェクトを生成
     $publisher = new Publisher();
     // Pubsubhubbubを送るサーバーをセット
     $publisher->addHubUrls(self::$pubsubhubbub_server);
     // ページをセット
     $publisher->addUpdatedTopicUrls(array($this->wiki->uri()));
     $publisher->notifyAll();
     if (!$publisher->isSuccess()) {
         // check for errors
         $errors = $publisher->getErrors();
         $failedHubs = array();
         foreach ($errors as $error) {
             $failedHubs[] = $error['hubUrl'];
         }
         return $failedHubs;
     }
     return null;
 }