本文整理汇总了PHP中RPC::commit方法的典型用法代码示例。如果您正苦于以下问题:PHP RPC::commit方法的具体用法?PHP RPC::commit怎么用?PHP RPC::commit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RPC
的用法示例。
在下文中一共展示了RPC::commit方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ajaxShowPosition
function ajaxShowPosition($pos)
{
list($lat, $lon) = explode(',', $pos);
$pos = json_decode(file_get_contents('http://nominatim.openstreetmap.org/reverse?format=json&lat=' . $lat . '&lon=' . $lon . '&zoom=27&addressdetails=1'));
RPC::call('movim_fill', 'postpublishlocation', (string) $pos->display_name);
RPC::commit();
}
示例2: onLocationPublishError
function onLocationPublishError($error)
{
Notification::append(null, $error);
RPC::call('movim_delete', 'mapdiv');
RPC::call('movim_delete', 'mapdata');
RPC::commit();
}
示例3: ajaxUnregister
function ajaxUnregister()
{
$cd = new \Modl\ConfigDAO();
$config = $cd->get();
$config->unregister = !$config->unregister;
$cd->set($config);
RPC::call('MovimUtils.reloadThis');
RPC::commit();
}
示例4: onSessionInitiate
function onSessionInitiate($jingle)
{
$jts = new \JingletoSDP($jingle);
$sdp = $jts->generate();
$cd = new \Modl\ContactDAO();
$contact = $cd->get(cleanJid((string) $jingle->attributes()->initiator));
if (!isset($contact)) {
$contact = new Modl\Contact();
}
if ($sdp) {
RPC::call('movim_desktop_notification', $contact->getTrueName(), $this->__('visio.calling'), $contact->getPhoto('m'));
RPC::call('remoteSetJid', (string) $jingle->attributes()->initiator);
RPC::call('remoteCall', 'onOffer', $sdp);
RPC::commit();
}
}
示例5: colorize
$restart = true;
}
#fwrite(STDERR, colorize($message, 'yellow')." : ".colorize('received', 'green')."\n");
#fwrite(STDERR, colorize(getenv('sid'), 'yellow')." widgets : ".\sizeToCleanSize(memory_get_usage())."\n");
\Moxl\API::clear();
\RPC::clear();
if (!$parser->parse($message)) {
fwrite(STDERR, colorize(getenv('sid'), 'yellow') . " " . $parser->getError() . "\n");
}
if ($restart) {
$session = \Sessionx::start();
\Moxl\Stanza\Stream::init($session->host);
stream_set_blocking($conn->stream, 0);
$restart = false;
}
$msg = \RPC::commit();
\RPC::clear();
if (!empty($msg)) {
echo base64_encode(gzcompress(json_encode($msg), 9)) . "";
#fwrite(STDERR, colorize($msg.' '.strlen($msg), 'yellow')." : ".colorize('sent to browser', 'green')."\n");
}
$xml = \Moxl\API::commit();
\Moxl\API::clear();
if (!empty($xml)) {
$conn->write(trim($xml));
#fwrite(STDERR, colorize(trim($xml), 'yellow')." : ".colorize('sent to XMPP', 'green')."\n");
}
}
// Two ticks to be sure that we get everything from the socket, sic…
$loop->tick();
$loop->tick();
示例6: onGroupMemberList
function onGroupMemberList($list)
{
$html = $this->prepareList($list);
RPC::call('movim_fill', 'memberlist', $html);
RPC::commit();
}
示例7: onMyVcard4NotReceived
function onMyVcard4NotReceived()
{
Notification::append(null, $this->__('vcard.not_updated'));
RPC::commit();
}
示例8: ajaxSearchContact
/**
* @brief Search for a contact to add
*/
function ajaxSearchContact($jid)
{
if (filter_var($jid, FILTER_VALIDATE_EMAIL)) {
RPC::call('movim_redirect', Route::urlize('contact', $jid));
RPC::commit();
} else {
Notification::append(null, $this->__('roster.jid_error'));
}
}
示例9: ajaxBookmarkMucAdd
function ajaxBookmarkMucAdd($form)
{
if (!filter_var($form['jid'], FILTER_VALIDATE_EMAIL)) {
$html = '<div class="message error">' . $this->__('chatroom.bad_id') . '</div>';
RPC::call('movim_fill', 'bookmarkmucadderror', $html);
RPC::commit();
} elseif (trim($form['name']) == '') {
$html = '<div class="message error">' . $this->__('chatroom.empty_name') . '</div>';
RPC::call('movim_fill', 'bookmarkmucadderror', $html);
RPC::commit();
} else {
$item = array('type' => 'conference', 'name' => $form['name'], 'autojoin' => $form['autojoin'], 'nick' => $form['nick'], 'jid' => $form['jid']);
$this->ajaxSetBookmark($item);
}
}
示例10: refresh
function refresh()
{
RPC::call('movim_reload_this');
RPC::commit();
}
示例11: onSubscriptionsList
function onSubscriptionsList($list)
{
$html = $this->prepareList($list);
RPC::call('movim_fill', 'subscriptionslist', $html);
RPC::commit();
}
示例12: create
public function create()
{
switch ($this->stream->getName()) {
case "stream":
$node = $this->stream->iq->query->x;
break;
case "pubsub":
$node = $this->stream->configure->x;
break;
case "command":
$node = $this->stream->x;
break;
default:
$node = $this->stream->x;
break;
}
foreach ($this->inputs as $key => $value) {
if ($value === '' && $this->stream->getName() == "stream") {
RPC::call('movim_reload', Route::urlize('account', 'datamissing'));
RPC::commit();
exit;
} elseif (substr($key, 0, 8) == 'generic_') {
$key = str_replace('generic_', '', $key);
if (!is_string($value)) {
$value = $value->value;
}
$node->addChild($key, $value);
} elseif ($value->attributes) {
$field = $node->addChild('field');
if ($value == 'true' || $value === 1) {
$value = '1';
}
if ($value == 'false' || $value === 0) {
$value = '0';
}
$field->addChild('value', trim($value->value));
if (isset($value->attributes->required)) {
$field->addChild('required', '');
}
$field->addAttribute('var', $value->attributes->name);
$field->addAttribute('type', $value->attributes->xmpptype);
$field->addAttribute('label', $value->attributes->xmpplabel);
} else {
$field = $node->addChild('field');
if ($value == 'true') {
$value = '1';
}
if ($value == 'false') {
$value = '0';
}
if (is_bool($value)) {
$value = $value ? '1' : '0';
}
$field->addChild('value', trim($value));
$field->addAttribute('var', trim($key));
}
}
}