当前位置: 首页>>代码示例>>PHP>>正文


PHP Lobby::getHostname方法代码示例

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


在下文中一共展示了Lobby::getHostname方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __constructStatic

 public static function __constructStatic()
 {
     if (!isset($_COOKIE['csrfToken'])) {
         self::$token = Helper::randStr(10);
         setcookie("csrfToken", self::$token, 0, "/", Lobby::getHostname());
     } else {
         self::$token = $_COOKIE['csrfToken'];
     }
 }
开发者ID:LobbyOS,项目名称:server,代码行数:9,代码来源:CSRF.php

示例2: page

 public function page($p)
 {
     /**
      * Clean up Assets
      */
     \Assets::removeCSS(array("theme.hine-/src/dashboard/css/scrollbar.css", "theme.hine-/src/dashboard/css/jquery.contextmenu.css", "theme.hine-/src/dashboard/css/dashboard.css", "theme.hine-/src/main/lib/jquery-ui/jquery-ui.css"));
     \Assets::js("jqueryui", "");
     \Assets::removeJS(array("theme.hine-/src/dashboard/js/scrollbar.js", "theme.hine-/src/dashboard/js/jquery.contextmenu.js", "theme.hine-/src/dashboard/js/dashboard.js", "app"));
     /**
      * Mobile
      */
     Hooks::addAction("head.end", function () {
         echo '<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" async="async" defer="defer">';
         echo '<meta name="viewport" content="width=device-width, initial-scale=1">';
         if (\Lobby::getHostname() != "server.lo" . "bby.sim") {
             echo '<script>if (window.location.protocol != "https:") window.location.href = "https:" + window.location.href.substring(window.location.protocol.length);</script>';
         }
     });
     /**
      * 
      */
     Hooks::addAction("panel.end", function () {
         echo '<a href="#" data-activates="lobby-nav" id="lobby-nav-btn"><i class="material-icons">menu</i></a>';
         echo '<ul class="side-nav" id="lobby-nav">
     <li><a href="/">Lobby</a></li>
     <li><a href="/apps">Apps</a></li>
     <li><a href="/download">Download</a></li>
     <li><a href="/web-readme">Demo</a></li>
     <li><a href="/docs">Documentation</a></li>
   </ul>';
         echo '<script>lobby.load(function(){$("#lobby-nav-btn").sideNav({menuWidth: 200});});</script>';
     });
     /**
      * Add notifications
      */
     \Lobby\UI\Panel::addNotifyItem("lobby-0-6-released", array("contents" => "Lobby " . $this->lobby_version . " Released", "href" => $this->lobby_annoucement, "icon" => "update"));
     \Lobby\UI\Panel::addNotifyItem("z-new-game", array("contents" => "New Site Compressor!", "href" => "https://lobby.subinsb.com/apps/site-compressor", "icon" => "new"));
     $path = explode("/", $p);
     if ($path[1] === "docs") {
         $doc = isset($path[2]) ? str_replace("/", ".", substr_replace($p, "", 0, 6)) : "index";
         $this->menu_items();
         \Assets::removeJS("theme.hine-/src/main/js/init.js");
         return $this->inc("/src/page/docs.php", array("doc" => $doc));
     } elseif ($path[1] === "mods") {
         $mod = isset($path[2]) ? str_replace("/", ".", substr_replace($p, "", 0, 6)) : "index";
         $this->menu_items();
         \Assets::removeJS("theme.hine-/src/main/js/init.js");
         return $this->inc("/src/page/mods.php", array("doc" => $mod));
     } else {
         if ($path[1] == "api") {
             $node = isset($path[2]) ? $path[2] : "index";
             return $this->inc("/src/page/api.php", array("node" => $node, "path" => $path));
         } else {
             if ($path[1] == "me") {
                 $this->menu_items();
                 $node = isset($path[2]) ? $path[2] : "index";
                 return $this->inc("/src/page/me.php", array("node" => $node, "path" => $path));
             } else {
                 if ($path[1] == "apps") {
                     $this->menu_items();
                     $node = isset($path[2]) ? $path[2] : "index";
                     return $this->inc("/src/page/apps.php", array("node" => $node));
                 } else {
                     if ($path[1] == "u") {
                         $this->menu_items();
                         $node = isset($path[2]) ? $path[2] : "index";
                         return $this->inc("/src/page/u.php", array("user" => $node));
                     } else {
                         $this->menu_items();
                         return "auto";
                     }
                 }
             }
         }
     }
 }
开发者ID:LobbyOS,项目名称:server,代码行数:76,代码来源:App.php


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