本文整理汇总了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']);
}
示例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);
}