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


PHP Lobby::getLID方法代码示例

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


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

示例1: json_encode

        /**
         * If the $appID is in the queue, then give the download status of it
         * If the updated value is less than 20 seconds ago, then restart the download
         */
        if (isset($appInstallQueue[$appID]) && $appInstallQueue[$appID]["updated"] > strtotime("-20 seconds")) {
            echo json_encode(array("statusID" => $appInstallQueue[$appID]["statusID"], "status" => $appInstallQueue[$appID]["status"]));
        } else {
            $appInfo = \Lobby\Server::store(array("get" => "app", "id" => $appID));
            /**
             * App doesn't exist on Lobby Store
             */
            if ($appInfo === "false") {
                echo json_encode(array("status" => "error", "error" => "App Doesn't Exist"));
            } else {
                $appName = $appInfo["name"];
                $Process = new Process(Process::getPHPExecutable(), array("arguments" => array(L_DIR . "/admin/ajax/install-app-bg.php", \Lobby::getLID(), base64_encode(serialize($_SERVER)), $appID)));
                /**
                 * Get the command used to execute install-app-bg.php
                 */
                $command = $Process->start(function () use($appID) {
                    /**
                     * This callback will close the connection between browser and server,
                     * http://stackoverflow.com/q/36968552/1372424
                     */
                    echo json_encode(array("statusID" => "download_intro", "status" => "Downloading <b>{$appID}</b>..."));
                });
                \Lobby::log("To install app '{$appID}', this command was executed : {$command}");
            }
        }
    }
}
开发者ID:LobbyOS,项目名称:server,代码行数:31,代码来源:install-app.php

示例2: unserialize

/**
 * Argument #1 should equal the Lobby Unique ID
 * Argument #2 is $_SERVER variable
 * Argument #3 is App ID to install
 */
if (isset($argv[2])) {
    $_SERVER = unserialize(base64_decode($argv[2]));
    require __DIR__ . "/../../load.php";
} else {
    exit;
}
use Lobby\Apps;
use Lobby\FS;
use Lobby\Update;
if ($argv[1] === \Lobby::getLID() && isset($argv[3])) {
    $appID = $argv[3];
    function sendStatusToLobby($statusID, $status)
    {
        global $appID;
        Lobby\DB::saveJSONOption("lobby_app_downloads", array($appID => array("statusID" => $statusID, "status" => $status, "updated" => time())));
    }
    /**
     * Record the last percentage of data downloaded
     * This to know whether download has progressed from previous state
     */
    $lastPercentage = 0;
    \Lobby\Update::$progress = function ($resource, $download_size, $downloaded, $upload_size, $uploaded = "") use($appID, $lastPercentage) {
        /**
         * On new versions of cURL, $resource parameter is not passed
         * So, swap vars if it doesn't exist
开发者ID:LobbyOS,项目名称:server,代码行数:30,代码来源:install-app-bg.php

示例3: makeData

 /**
  * Append Lobby Info to POST data
  */
 public static function makeData($data)
 {
     return array_replace_recursive(array("lobby" => array("lid" => \Lobby::getLID(), "version" => \Lobby::$version)), $data);
 }
开发者ID:LobbyOS,项目名称:server,代码行数:7,代码来源:Server.php


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