• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP RPC类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中RPC的典型用法代码示例。如果您正苦于以下问题:PHP RPC类的具体用法?PHP RPC怎么用?PHP RPC使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了RPC类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
 }
开发者ID:Nyco,项目名称:movim,代码行数:7,代码来源:WidgetCommon.php


示例2: ajaxAddChatroom

 function ajaxAddChatroom()
 {
     $r = new Rooms();
     $r->ajaxChatroomAdd(array('jid' => '[email protected]', 'name' => 'Movim Chatroom', 'nick' => false, 'autojoin' => 0));
     $r->ajaxJoin('[email protected]');
     RPC::call('MovimUtils.redirect', $this->route('chat'));
 }
开发者ID:Anon215,项目名称:movim,代码行数:7,代码来源:Help.php


示例3: onLocationPublishError

 function onLocationPublishError($error)
 {
     Notification::append(null, $error);
     RPC::call('movim_delete', 'mapdiv');
     RPC::call('movim_delete', 'mapdata');
     RPC::commit();
 }
开发者ID:christine-ho-dev,项目名称:movim,代码行数:7,代码来源:Location.php


示例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);
 }
开发者ID:Anon215,项目名称:movim,代码行数:26,代码来源:Init.php


示例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');
 }
开发者ID:rrsc,项目名称:freemed,代码行数:7,代码来源:ServerSerializationStreamReader.class.php


示例6: fill

 static function fill($html = '', $scroll = false)
 {
     RPC::call('movim_fill', 'dialog', $html);
     if ($scroll) {
         RPC::call('Dialog.addScroll');
     }
 }
开发者ID:christine-ho-dev,项目名称:movim,代码行数:7,代码来源:Dialog.php


示例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'));
 }
开发者ID:bartuspan,项目名称:movim,代码行数:8,代码来源:Avatar.php


示例8: ajaxUnregister

 function ajaxUnregister()
 {
     $cd = new \Modl\ConfigDAO();
     $config = $cd->get();
     $config->unregister = !$config->unregister;
     $cd->set($config);
     RPC::call('MovimUtils.reloadThis');
     RPC::commit();
 }
开发者ID:Anon215,项目名称:movim,代码行数:9,代码来源:Api.php


示例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'));
 }
开发者ID:Trim,项目名称:movim,代码行数:9,代码来源:Config.php


示例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');
 }
开发者ID:spthaolt,项目名称:movim,代码行数:11,代码来源:Menu.php


示例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);
     }
 }
开发者ID:Anon215,项目名称:movim,代码行数:15,代码来源:Notifs.php


示例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;
 }
开发者ID:salted-herring,项目名称:salted-library,代码行数:15,代码来源:Currency.php


示例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();
     }
 }
开发者ID:christine-ho-dev,项目名称:movim,代码行数:16,代码来源:VisioExt.php


示例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'));
     }
 }
开发者ID:Trim,项目名称:movim,代码行数:19,代码来源:Account.php


示例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');
 }
开发者ID:ajira86,项目名称:movim,代码行数:21,代码来源:AdHoc.php


示例16: ajaxDisplay

 function ajaxDisplay()
 {
     $tmp = [];
     foreach (scandir(USERS_PATH) as $f) {
         if (is_dir(USERS_PATH . '/' . $f)) {
             $time = filemtime(USERS_PATH . '/' . $f . '/index.html');
             if ($time) {
                 array_push($tmp, $time);
             }
         }
     }
     sort($tmp);
     $days = [];
     $pattern = "M Y";
     foreach ($tmp as $k => $time) {
         $key = date($pattern, $time);
         if (isset($days[$key])) {
             $days[$key]++;
         } else {
             $days[$key] = 1;
         }
     }
     $data = new stdClass();
     $data->labels = [];
     $data->datasets = [];
     $first = new StdClass();
     $first->label = "Monthly Subscriptions";
     $first->fillColor = "rgba(255,152,0,0.5)";
     $first->strokeColor = "rgba(255,152,0,0.8)";
     $first->highlightFill = "rgba(220,220,220,0.75)";
     $first->highlightStroke = "rgba(220,220,220,1)";
     $values = [];
     foreach ($days as $key => $value) {
         array_push($data->labels, $key);
         array_push($values, $value);
     }
     $first->data = $values;
     array_push($data->datasets, $first);
     RPC::call('Statistics.drawGraphs', $data);
 }
开发者ID:Anon215,项目名称:movim,代码行数:40,代码来源:Statistics.php


示例17: ajaxLogin

 function ajaxLogin($username)
 {
     $validate_user = Validator::string()->length(4, 40);
     if (!$validate_user->validate($username)) {
         Notification::append(null, $this->__('login_anonymous.bad_username'));
         return;
     }
     // We get the Server Configuration
     $cd = new \Modl\ConfigDAO();
     $config = $cd->get();
     $host = 'anonymous.jappix.com';
     $password = 'AmISnowden?';
     // We try to get the domain
     $domain = \Moxl\Utils::getDomain($host);
     // We launch the XMPP socket
     RPC::call('register', $host);
     // We set the username in the session
     $s = Session::start();
     $s->set('username', $username);
     // We create a new session or clear the old one
     $s = Sessionx::start();
     $s->init($username, $password, $host, $domain);
     \Moxl\Stanza\Stream::init($host);
 }
开发者ID:Nyco,项目名称:movim,代码行数:24,代码来源:LoginAnonymous.php


示例18: prepareMessages

 function prepareMessages($jid)
 {
     if (!$this->validateJid($jid)) {
         return;
     }
     $md = new \Modl\MessageDAO();
     $messages = $md->getContact(echapJid($jid), 0, 30);
     if (is_array($messages)) {
         $messages = array_reverse($messages);
         foreach ($messages as $message) {
             $this->prepareMessage($message);
         }
     }
     $view = $this->tpl();
     $view->assign('jid', $jid);
     $cd = new \Modl\ContactDAO();
     $contact = $cd->get($jid);
     $me = $cd->get();
     if ($me == null) {
         $me = new \Modl\Contact();
     }
     $view->assign('contact', $contact);
     $view->assign('me', false);
     $left = $view->draw('_chat_bubble', true);
     $view->assign('contact', $me);
     $view->assign('me', true);
     $right = $view->draw('_chat_bubble', true);
     $room = $view->draw('_chat_bubble_room', true);
     RPC::call('Chat.setBubbles', $left, $right, $room);
     RPC::call('Chat.appendMessages', $messages);
 }
开发者ID:Trim,项目名称:movim,代码行数:31,代码来源:Chat.php


示例19: displayServer

 private function displayServer($server)
 {
     if (!$this->validateServer($server)) {
         return;
     }
     $html = $this->prepareServer($server);
     RPC::call('movim_fill', 'groups_widget', $html);
     RPC::call('Groups.refresh');
 }
开发者ID:vijo,项目名称:movim,代码行数:9,代码来源:Groups.php


示例20: elseif

     if (isset($msg)) {
         if ($msg->func == 'message' && $msg->body != '') {
             $msg = $msg->body;
         } elseif ($msg->func == 'unregister') {
             \Moxl\Stanza\Stream::end();
         } elseif ($msg->func == 'register') {
             $cd = new \Modl\ConfigDAO();
             $config = $cd->get();
             $domain = \Moxl\Utils::getDomain($msg->host);
             #fwrite(STDERR, colorize('open a socket to '.$domain, 'yellow')." : ".colorize('sent to XMPP', 'green')."\n");
             $connector->create($domain, 5222)->then($xmpp_behaviour);
         }
     } else {
         return;
     }
     $rpc = new \RPC();
     $rpc->handle_json($msg);
     $msg = json_encode(\RPC::commit());
     \RPC::clear();
     if (!empty($msg)) {
         echo base64_encode(gzcompress($msg, 9)) . "";
         #fwrite(STDERR, colorize($msg, 'yellow')." : ".colorize('sent to the browser', 'green')."\n");
     }
     $xml = \Moxl\API::commit();
     \Moxl\API::clear();
     $loop->tick();
     if (!empty($xml) && $conn) {
         $conn->write(trim($xml));
         #fwrite(STDERR, colorize(trim($xml), 'yellow')." : ".colorize('sent to XMPP', 'green')."\n");
     }
 }
开发者ID:ajira86,项目名称:movim,代码行数:31,代码来源:linker.php



注:本文中的RPC类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP RSFormProHelper类代码示例发布时间:2022-05-23
下一篇:
PHP RM_UI_Strings类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap