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


PHP Response::head方法代码示例

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


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

示例1: onRecive

 /**
  * 接收到数据
  * @param $client_id
  * @param $data
  * @return unknown_type
  */
 function onRecive($client_id, $data)
 {
     $this->log($data);
     $request = $this->request($data);
     $response = new Response();
     $response->head['Date'] = gmdate("D, d M Y H:i:s T");
     $response->head['Server'] = 'Swoole';
     //        $response->head['KeepAlive'] = 'off';
     //        $response->head['Connection'] = 'close';
     // $response->head['Content-type'] = 'application/json';
     //$response->body = $request->get['callback'].'('.json_encode(array('successful'=>true)).')';
     //$response->head['Content-Length'] = strlen($response->body);
     $out = $response->head();
     //$out .= $response->body;
     $this->server->send($client_id, $out);
     for ($i = 0; $i < 10; $i++) {
         $this->server->send($client_id, '<script language="javascript">alert("msg on");</script>');
         sleep(1);
     }
     //处理data的完整性
     $this->server->close($client_id);
 }
开发者ID:jinguanio,项目名称:swoole_websocket,代码行数:28,代码来源:Comet.class.php

示例2: ser

$appID = \Request::get('app');
if ($appID !== null) {
    $app = \Lobby\Server::store(array("get" => "app", "id" => $appID));
    if ($app) {
        $page_title = $app['name'] . " | Lobby Store";
    }
}
?>
<html>
  <head>
    <?php 
\Assets::css("apps-grid", "/admin/css/apps-grid.css");
\Assets::css("lobby-store", "/admin/css/lobby-store.css");
\Assets::js("lobby-store", "/admin/js/lobby-store.js");
\Hooks::doAction("admin.head.begin");
\Response::head($page_title);
?>
  </head>
  <body>
    <?php 
\Hooks::doAction("admin.body.begin");
?>
    <div id="workspace">
      <div class="contents">
        <?php 
if ($appID !== null) {
    if ($app === false) {
        echo ser("404 - App Not Found", "App was not found in Lobby Store.");
    } else {
        $appImage = $app['image'] != "" ? $app['image'] : L_URL . "/includes/lib/lobby/image/blank.png";
        $c = $app['category'];
开发者ID:LobbyOS,项目名称:server,代码行数:31,代码来源:lobby-store.php

示例3:

<html>
  <head>
    <?php 
if (\Lobby::status("lobby.admin")) {
    \Hooks::doAction("admin.head.begin");
} else {
    \Hooks::doAction("head.begin");
}
\Response::head();
if (\Lobby::status("lobby.admin")) {
    \Hooks::doAction("admin.head.end");
} else {
    \Hooks::doAction("head.end");
}
?>
  </head>
  <body>
    <?php 
if (\Lobby::status("lobby.admin")) {
    \Hooks::doAction("admin.body.begin");
} else {
    \Hooks::doAction("body.begin");
}
?>
    <div id="workspace">
      <?php 
echo \Response::getPageContent();
?>
    </div>
  </body>
</html>
开发者ID:LobbyOS,项目名称:server,代码行数:31,代码来源:view.page.php

示例4: ser

<?php

require "../load.php";
?>
<html>
  <head>
    <?php 
\Hooks::doAction("admin.head.begin");
\Response::head("Modules");
?>
  </head>
  <body>
    <?php 
\Hooks::doAction("admin.body.begin");
?>
    <div id="workspace">
      <div class="contents">
        <h1>Modules</h1>
        <p>Modules extend the functionality of Lobby. This page shows the modules that are installed in Lobby. <a target="_blank" href="<?php 
echo L_SERVER;
?>
/mods">Read more about Modules</a></p>
        <?php 
$core_modules = \Lobby\Modules::get("core");
$custom_modules = \Lobby\Modules::get("custom");
$app_modules = \Lobby\Modules::get("app");
echo "<h3>Custom Modules</h3>";
echo "Manually installed modules are 'custom modules'";
if (count($custom_modules) == 0) {
    echo ser("No Custom Modules", "No custom modules are enabled or installed", false);
} else {
开发者ID:LobbyOS,项目名称:server,代码行数:31,代码来源:modules.php

示例5: array

            $error = array("Username / Password Wrong", "The username or password you submitted was wrong.");
        } else {
            if (is_array($login) && $login['status'] == "blocked") {
                $error = array("Account Blocked", "Too many login attempts. You can attempt login again after " . $login['minutes'] . " minutes (" . $login['seconds'] . " seconds)");
            } else {
                \Response::redirect("/admin");
            }
        }
    }
}
?>
<html>
  <head>
    <?php 
\Hooks::doAction("head.begin");
\Response::head("Admin Login");
?>
  </head>
  <body>
    <?php 
\Hooks::doAction("body.begin");
?>
    <div id="workspace">
      <div class="contents">
        <h2>Log In</h2>
        <form method="POST" action="<?php 
echo \Lobby::u("/admin/login");
?>
">
          <label clear>
            <span clear>Username</span>
开发者ID:LobbyOS,项目名称:server,代码行数:31,代码来源:login.php

示例6:

                Response::redirect("/admin/apps.php?app={$appID}&action=enable&show=1" . CSRF::getParam());
            } else {
                Response::redirect("/admin/apps.php?app={$appID}&action=enable-fail&show=1" . CSRF::getParam());
            }
        }
    }
}
?>
<html>
  <head>
    <?php 
\Assets::js("admin.apps.js", "/admin/js/apps.js");
\Assets::css("apps-grid", "/admin/css/apps-grid.css");
\Assets::css("apps", "/admin/css/apps.css");
\Hooks::doAction("admin.head.begin");
\Response::head("App Manager");
?>
  </head>
  <body>
    <?php 
\Hooks::doAction("admin.body.begin");
?>
    <div id="workspace">
      <div class="contents">
        <?php 
if ($appID !== null) {
    ?>
          <h2><?php 
    echo "<a href='" . Lobby::u("/admin/apps.php?app={$App->info['id']}") . "'>" . $App->info['name'] . "</a>";
    ?>
</h2>
开发者ID:LobbyOS,项目名称:server,代码行数:31,代码来源:apps.php

示例7: array

require "../load.php";
$install_step = Request::get('step');
?>
<!DOCTYPE html>
<html>
  <head>
    <?php 
\Lobby\UI\Themes::loadTheme();
\Hooks::doAction("head.begin");
/**
 * Install Head
 */
\Assets::css("install", "/admin/css/install.css");
\Assets::js("install", "/admin/js/install.js");
\Response::head("Install");
\Hooks::doAction("head.end");
?>
  </head>
  <body id="workspace">
     <div class="contents" id="<?php 
$steps = array("1", "2", "3", "4");
if (in_array($install_step, $steps)) {
    echo "step{$install_step}";
}
?>
">
        <h1 style="text-align: center;">
          <?php 
echo \Lobby::l(L_URL, "Install Lobby");
?>
开发者ID:LobbyOS,项目名称:server,代码行数:30,代码来源:install.php

示例8: htmlspecialchars

<?php

require "../load.php";
?>
<!DOCTYPE html>
<html>
  <head>
    <?php 
\Hooks::doAction("admin.head.begin");
\Assets::js("admin.apps.js", "/admin/js/install-app.js");
\Response::head("Install App");
?>
  </head>
  <body>
    <?php 
\Hooks::doAction("admin.body.begin");
?>
    <div id="workspace">
      <div class="contents">
        <?php 
$appID = Request::get("app");
$action = Request::get("action");
/**
 * Whether this is a request to show a message
 */
$show = Request::get("show") !== null;
$displayID = htmlspecialchars($appID);
$App = new \Lobby\Apps($appID);
if ($appID === null) {
    echo ser("Error", "No App is mentioned. Install Apps from <a href='lobby-store.php'>Lobby Store</a>");
} else {
开发者ID:LobbyOS,项目名称:server,代码行数:31,代码来源:install-app.php

示例9: sss

<?php

require "../load.php";
?>
<html>
  <head>
    <?php 
\Hooks::doAction("admin.head.begin");
\Response::head("Change Settings");
?>
  </head>
  <body>
    <?php 
\Hooks::doAction("admin.body.begin");
?>
    <div id="workspace">
      <div class="contents">
        <?php 
if (isset($_GET['updated']) && CSRF::check()) {
    echo sss("Updated", "Lobby was successfully updated to Version <b>" . \Lobby::$version . "</b> from the old " . htmlspecialchars($_GET['oldver']) . " version.");
}
if (isset($_POST['update_settings']) && \CSRF::check()) {
    /**
     * Sadly, PHP supports GMT+ and not UTC+
     */
    $time_zone = $_POST['timezone'];
    if ($time_zone === "") {
        Lobby\DB::saveOption("lobby_timezone", "UTC");
        \Lobby\Time::loadConfig();
    } else {
        if (@date_default_timezone_set($time_zone)) {
开发者ID:LobbyOS,项目名称:server,代码行数:31,代码来源:settings.php

示例10:

<?php

require "../load.php";
use Lobby\Update;
?>
<!DOCTYPE html>
<html>
  <head>
    <?php 
\Hooks::doAction("admin.head.begin");
\Response::head("Update");
?>
  </head>
  <body>
    <?php 
\Hooks::doAction("admin.body.begin");
?>
    <div id="workspace">
      <div class="contents">
        <h1>Update</h1>
        <p>Lobby and apps can be updated automatically.</p>
        <a class='btn blue' href='check-updates.php'>Check For Updates</a>
        <a href="<?php 
echo L_SERVER;
?>
/docs/update" target="_blank" class="btn pink">Help</a>
        <?php 
$action = Request::postParam("action");
$step = Request::get("step");
if ($action === null && $step === null) {
    if (Update::isCoreAvailable()) {
开发者ID:LobbyOS,项目名称:server,代码行数:31,代码来源:update.php


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