當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Subscriber::unsubscribe方法代碼示例

本文整理匯總了PHP中Subscriber::unsubscribe方法的典型用法代碼示例。如果您正苦於以下問題:PHP Subscriber::unsubscribe方法的具體用法?PHP Subscriber::unsubscribe怎麽用?PHP Subscriber::unsubscribe使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Subscriber的用法示例。


在下文中一共展示了Subscriber::unsubscribe方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testUnsubscribeSubscribe

 /**
  * @magentoDataFixture Magento/Newsletter/_files/subscribers.php
  * @magentoAppArea     frontend
  */
 public function testUnsubscribeSubscribe()
 {
     // Unsubscribe and verify
     $this->assertSame($this->_model, $this->_model->loadByCustomerId(1));
     $this->assertEquals($this->_model, $this->_model->unsubscribe());
     $this->assertEquals(Subscriber::STATUS_UNSUBSCRIBED, $this->_model->getSubscriberStatus());
     // Subscribe and verify
     $this->assertEquals(Subscriber::STATUS_SUBSCRIBED, $this->_model->subscribe('customer@example.com'));
     $this->assertEquals(Subscriber::STATUS_SUBSCRIBED, $this->_model->getSubscriberStatus());
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:14,代碼來源:SubscriberTest.php

示例2: testUnsubscribe

 public function testUnsubscribe()
 {
     $sub = new Subscriber($this->mock);
     $sub->unsubscribe('http://hub.tld/subscribe', 'http://subscriber.tld/callback', 'http://publisher.tld/topic', 'sync');
     $this->markTestIncomplete('This test has not been implemented yet.');
 }
開發者ID:charlycoste,項目名稱:phpubsub,代碼行數:6,代碼來源:subscriberTest.php

示例3: EventChannel

 *    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 *    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 *    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *
 * $Id$
 *
 ******************************************************************************/
include "../interface/EventChannel.php";
include "../interface/Subscriber.php";
$subject = "testsubj";
print "generating Famouso EventChannel\n";
$EventChannel = new EventChannel($subject);
print "generating PHP Subscriber\n";
$Subscriber = new Subscriber($EventChannel);
print "sending subscribtion\n";
if (!$Subscriber->subscribe()) {
    print "subscribtion failed - exit\n";
    exit;
}
print "getting all events by polling\n";
for ($i = 0; $i < 10; $i++) {
    $event = $Subscriber->getEvent();
    print $i . " event\n";
    print "subject: " . $event['subject'] . "\n";
    print "length : " . $event['length'] . "\n";
    print "data   : " . $event['data'] . "\n";
}
print "sending unsubscribtion\n";
$Subscriber->unsubscribe();
開發者ID:steup,項目名稱:FAMOUSO,代碼行數:30,代碼來源:TestSubscriber.php

示例4: Subscriber

<?php

// simple example for the PHP pubsubhubbub Subscriber
// as defined at http://code.google.com/p/pubsubhubbub/
// written by Josh Fraser | joshfraser.com | josh@eventvue.com
// Released under Apache License 2.0
include "subscriber.php";
$hub_url = "http://pubsubhubbub.appspot.com";
$callback_url = "put your own endpoint here";
$feed = "http://feeds.feedburner.com/onlineaspect";
// create a new subscriber
$s = new Subscriber($hub_url, $callback_url);
// subscribe to a feed
$s->subscribe($feed);
// unsubscribe from a feed
$s->unsubscribe($feed);
?>

開發者ID:Karthick6038,項目名稱:php-subscriber,代碼行數:17,代碼來源:example.php

示例5: unsubscribe

 /**
  * unsubscribing means losing the socket and kill the child-process
  */
 public function unsubscribe()
 {
     parent::unsubscribe();
     posix_kill($this->m_PidChild, SIGABRT);
 }
開發者ID:steup,項目名稱:FAMOUSO,代碼行數:8,代碼來源:Subscriber_Posix.php


注:本文中的Subscriber::unsubscribe方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。