本文整理汇总了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());
}
示例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.');
}
示例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();
示例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);
?>
示例5: unsubscribe
/**
* unsubscribing means losing the socket and kill the child-process
*/
public function unsubscribe()
{
parent::unsubscribe();
posix_kill($this->m_PidChild, SIGABRT);
}