当前位置: 首页>>代码示例>>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;未经允许,请勿转载。