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


PHP Streams::close方法代碼示例

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


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

示例1: Streams_stream_delete

/**
 * Used to close an existing stream. A cron job may delete this stream later.
 *
 * @module Streams
 * @class Streams_stream
 * @method delete
 * @static
 * @param {array} $_REQUEST
 * @param {string} $_REQUEST.publisherId The id of the stream publisher
 * @param {string} $_REQUEST.streamName The name of the stream the user will be invited to
 */
function Streams_stream_delete()
{
    $user = Users::loggedInUser(true);
    $publisherId = Streams::requestedPublisherId(true);
    $streamName = Streams::requestedName(true);
    Streams::$cache['result'] = Streams::close($user->id, $publisherId, $streamName);
    // NOTE: we did not delete the stream. That will have to be done in a cron job like this:
    // // Clean up access
    // $stream->delete();
    // Streams_Access::delete()->where(array(
    // 	'publisherId' => $stream->publisherId,
    // 	'streamName' => $stream->name
    // ))->execute();
    Q_Response::setSlot('result', Streams::$cache['result']);
}
開發者ID:dmitriz,項目名稱:Platform,代碼行數:26,代碼來源:delete.php

示例2: close

 /**
  * Closes a stream, which prevents anyone from posting messages to it
  * unless they have WRITE_LEVEL >= "close", as well as attempting to remove
  * all relations to other streams. A "cron job" can later go and delete
  * closed streams. The reason you should avoid deleting streams right away
  * is that other subscribers may still want to receive the last messages
  * posted to the stream.
  * @method close
  * @param {string} $asUserId The id of the user who would be closing the stream
  * @param {array} [$options=array()] Can include "skipAccess"
  * @static
  */
 function close($asUserId, $options = array())
 {
     return Streams::close($asUserId, $this->publisherId, $this->name, $options);
 }
開發者ID:dmitriz,項目名稱:Platform,代碼行數:16,代碼來源:Stream.php


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