本文整理汇总了PHP中Chat::WriteChannelCache方法的典型用法代码示例。如果您正苦于以下问题:PHP Chat::WriteChannelCache方法的具体用法?PHP Chat::WriteChannelCache怎么用?PHP Chat::WriteChannelCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chat
的用法示例。
在下文中一共展示了Chat::WriteChannelCache方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Chat
<?php
require_once 'core.php';
if (!isset($_POST['from']) || !isset($_POST['channel_id']) || (int) $_POST['channel_id'] < 0 || !isset($_POST['message']) || !isset($_POST['signature']) || $_POST['signature'] != hash('sha512', $_POST['from'] . $_POST['channel_id'] . $_POST['message'] . FS_TO_CHAT_KEY)) {
print 'Wrong input.';
exit;
}
require_once 'chat.php';
global $memcache;
$chat = new Chat($memcache);
$chat->SetDatabase();
$chat->GetAuthInfo($_POST['from']);
if (isset($chat->user['error']) && $chat->user['error'] !== '') {
print $chat->user['error'];
exit;
}
if ($res = $chat->WriteMessage($_POST['message'])) {
$chat->WriteChannelCache((int) $_POST['channel_id']);
print $res;
exit;
} else {
print 'WriteMessage false';
exit;
}
示例2: Chat
<?php
require_once 'core.php';
if (!isset($_POST['channels']) || !isset($_POST['key']) || $_POST['key'] != DRUPAL_TO_CHAT_KEY) {
exit;
}
require_once 'chat.php';
global $memcache;
$chat = new Chat($memcache);
$chat->SetDatabase();
if (!is_array($_POST['channels'])) {
$channels = array($_POST['channels']);
} else {
$channels = $_POST['channels'];
}
foreach ($channels as $channel) {
$chat->WriteChannelCache((int) $channel);
}