當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Console::updateConsoleInfo方法代碼示例

本文整理匯總了PHP中Console::updateConsoleInfo方法的典型用法代碼示例。如果您正苦於以下問題:PHP Console::updateConsoleInfo方法的具體用法?PHP Console::updateConsoleInfo怎麽用?PHP Console::updateConsoleInfo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Console的用法示例。


在下文中一共展示了Console::updateConsoleInfo方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: realpath

<?php

//This script will update all records in the consoleinfo table
define('FS_ROOT', realpath(dirname(__FILE__)));
require_once FS_ROOT . "/../../www/config.php";
require_once FS_ROOT . "/../../www/lib/framework/db.php";
require_once FS_ROOT . "/../../www/lib/console.php";
$console = new Console(true);
$db = new Db();
$res = $db->queryDirect(sprintf("SELECT searchname, ID from releases where consoleinfoID IS NULL and categoryID in ( select ID from category where parentID = %d ) ORDER BY id DESC LIMIT %d", Category::CAT_PARENT_GAME, Console::NUMTOPROCESSPERTIME));
if ($res != null) {
    while ($arr = $db->getAssocArray($res)) {
        $conInfo = $console->parseTitle($arr['searchname']);
        if ($conInfo !== false) {
            echo 'Searching ' . $conInfo['release'] . '<br />';
            $con = $console->updateConsoleInfo($conInfo);
            if ($con !== false) {
                print_r($con);
            } else {
                echo 'Console not found';
            }
        }
    }
}
開發者ID:scriptzteam,項目名稱:newzNZB-premium-indexer,代碼行數:24,代碼來源:getConsole.php

示例2: dirname

<?php

//This script will update all records in the consoleinfo table
require_once dirname(__FILE__) . '/../../../www/config.php';
use nzedb\db\Settings;
$pdo = new Settings();
$console = new Console(['Echo' => true, 'Settings' => $pdo]);
$res = $pdo->queryDirect(sprintf("SELECT searchname, id FROM releases WHERE consoleinfoid IS NULL AND categoryid BETWEEN 1000 AND 1999 ORDER BY id DESC"));
if ($res instanceof Traversable) {
    echo $pdo->log->header("Updating console info for " . number_format($res->rowCount()) . " releases.");
    foreach ($res as $arr) {
        $starttime = microtime(true);
        $gameInfo = $console->parseTitle($arr['searchname']);
        if ($gameInfo !== false) {
            $game = $console->updateConsoleInfo($gameInfo);
            if ($game === false) {
                echo $pdo->log->primary($gameInfo['release'] . ' not found');
            }
        }
        // amazon limits are 1 per 1 sec
        $diff = floor((microtime(true) - $starttime) * 1000000);
        if (1000000 - $diff > 0) {
            echo $pdo->log->alternate("Sleeping");
            usleep(1000000 - $diff);
        }
    }
}
開發者ID:Jay204,項目名稱:nZEDb,代碼行數:27,代碼來源:getConsole.php


注:本文中的Console::updateConsoleInfo方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。