本文整理汇总了PHP中RPC类的典型用法代码示例。如果您正苦于以下问题:PHP RPC类的具体用法?PHP RPC怎么用?PHP RPC使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RPC类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: ajaxAddChatroom
function ajaxAddChatroom()
{
$r = new Rooms();
$r->ajaxChatroomAdd(array('jid' => 'movim@conference.movim.eu', 'name' => 'Movim Chatroom', 'nick' => false, 'autojoin' => 0));
$r->ajaxJoin('movim@conference.movim.eu');
RPC::call('MovimUtils.redirect', $this->route('chat'));
}
示例3: onLocationPublishError
function onLocationPublishError($error)
{
Notification::append(null, $error);
RPC::call('movim_delete', 'mapdiv');
RPC::call('movim_delete', 'mapdata');
RPC::commit();
}
示例4: onConfigured
function onConfigured($package)
{
$node = $package->content;
switch ($node) {
case 'storage:bookmarks':
$notif = $this->__('init.bookmark');
break;
case 'urn:xmpp:vcard4':
$notif = $this->__('init.vcard4');
break;
case 'urn:xmpp:avatar:data':
$notif = $this->__('init.avatar');
break;
case 'http://jabber.org/protocol/geoloc':
$notif = $this->__('init.location');
break;
case 'urn:xmpp:pubsub:subscription':
$notif = $this->__('init.subscriptions');
break;
case 'urn:xmpp:microblog:0':
$notif = $this->__('init.microblog');
break;
}
RPC::call('Init.setNode', $node);
Notification::append(null, $notif);
}
示例5: __construct
public function __construct(MappedClassLoader $mappedClassLoader, SerializationPolicyProvider $serializationPolicyProvider)
{
$this->mappedClassLoader = $mappedClassLoader;
$this->serializationPolicyProvider = $serializationPolicyProvider;
$this->serializationPolicy = RPC::getDefaultSerializationPolicy();
$this->logger = LoggerManager::getLogger('gwtphp.rpc.impl.ServerSerializationStreamReader');
}
示例6: fill
static function fill($html = '', $scroll = false)
{
RPC::call('movim_fill', 'dialog', $html);
if ($scroll) {
RPC::call('Dialog.addScroll');
}
}
示例7: onMyAvatarError
function onMyAvatarError()
{
$cd = new \modl\ContactDAO();
$me = $cd->get();
$html = $this->prepareForm($me);
RPC::call('movim_fill', 'avatar_form', $html);
Notification::append(null, $this->__('avatar.not_updated'));
}
示例8: ajaxUnregister
function ajaxUnregister()
{
$cd = new \Modl\ConfigDAO();
$config = $cd->get();
$config->unregister = !$config->unregister;
$cd->set($config);
RPC::call('MovimUtils.reloadThis');
RPC::commit();
}
示例9: onConfig
function onConfig($package)
{
$data = (array) $package->content;
$this->user->setConfig($data);
$html = $this->prepareConfigForm();
RPC::call('movim_fill', 'config_widget', $html);
RPC::call('Config.load');
Notification::append(null, $this->__('config.updated'));
}
示例10: ajaxGet
function ajaxGet($type = 'all', $server = null, $node = null, $page = 0)
{
$html = $this->prepareList($type, $server, $node, $page);
if ($page > 0) {
RPC::call('movim_append', 'menu_wrapper', $html);
} else {
RPC::call('movim_fill', 'menu_widget', $html);
RPC::call('movim_posts_unread', 0);
}
RPC::call('Menu.refresh');
}
示例11: onNotifs
function onNotifs($from = false)
{
$html = $this->prepareNotifs();
RPC::call('MovimTpl.fill', '#notifs_widget', $html);
RPC::call('Notifs.refresh');
if (is_string($from)) {
$cd = new \Modl\ContactDAO();
$contact = $cd->get($from);
$avatar = $contact->getPhoto('s');
if ($avatar == false) {
$avatar = null;
}
Notification::append('invite|' . $from, $contact->getTrueName(), $this->__('notifs.wants_to_talk', $contact->getTrueName()), $avatar, 4);
}
}
示例12: exchange
public static function exchange($amount, $from = 'NZD', $to = 'CNY')
{
$url = "http://www.google.com/finance/converter?a={$amount}&from={$from}&to={$to}";
if ($data = RPC::fetch($url)) {
$dom = new \DOMDocument();
@$dom->loadHTML($data);
$finder = new \DomXPath($dom);
$classname = "bld";
$nodes = $finder->query("//*[contains(concat(' ', normalize-space(@class), ' '), ' {$classname} ')]");
$node = $nodes->item(0)->nodeValue;
$amount = str_replace(' CNY', '', $node);
return number_format($amount, 2, '.', ',');
}
return false;
}
示例13: 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();
}
}
示例14: ajaxChangePassword
function ajaxChangePassword($form)
{
$validate = Validator::string()->length(6, 40);
$p1 = $form->password->value;
$p2 = $form->password_confirmation->value;
if ($validate->validate($p1) && $validate->validate($p2)) {
if ($p1 == $p2) {
$arr = explodeJid($this->user->getLogin());
$cp = new ChangePassword();
$cp->setTo($arr['server'])->setUsername($arr['username'])->setPassword($p1)->request();
} else {
RPC::call('Account.resetPassword');
Notification::append(null, $this->__('account.password_not_same'));
}
} else {
RPC::call('Account.resetPassword');
Notification::append(null, $this->__('account.password_not_valid'));
}
}
示例15: onCommand
function onCommand($package)
{
$command = $package->content;
$view = $this->tpl();
if (isset($command->note)) {
$view->assign('note', $command->note);
Dialog::fill($view->draw('_adhoc_note', true));
}
if (isset($command->x)) {
$xml = new \XMPPtoForm();
$form = $xml->getHTML($command->x->asXML());
$view->assign('form', $form);
$view->assign('attributes', $command->attributes());
$view->assign('actions', null);
if (isset($command->actions)) {
$view->assign('actions', $command->actions);
}
Dialog::fill($view->draw('_adhoc_form', true), true);
}
RPC::call('AdHoc.initForm');
}