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


PHP DatabaseManager::getLastTimestamp方法代碼示例

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


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

示例1: DatabaseManager

$dbMgr = new DatabaseManager(true);
$objectFactory = new ObjectFactory();
$formBuilder = new FormBuilder();
if (isset($argArray['re'])) {
    $reactionID = $argArray['re'];
    $reaction = $objectFactory->create(ObjectFactory::REACTION, $reactionID);
}
if (isset($argArray['c']) && $reaction->getReactionType() == 2) {
    $chain = 1;
    $chainStr = "Reaction Chain";
} else {
    $chain = 0;
    $chainStr = "Reaction";
}
if (isset($argArray['d'])) {
    $datetime = $dbMgr->getLastTimestamp($argArray['d'], 300);
    $dateChanged = 1;
} else {
    $datetime = $dbMgr->getLastTimestamp(time(), 300);
}
$options = array("r" => $_SESSION['params']['r'], "c" => $chain, "s" => $_SESSION['params']['s'], "g" => $_SESSION['params']['g'], "sy" => $_SESSION['params']['sy'], "i" => $_SESSION['params']['i'], "f" => $_SESSION['params']['f'], "o" => $_SESSION['params']['o'], "st" => $_SESSION['params']['st'], "b" => $_SESSION['params']['b'], "t" => $_SESSION['params']['t']);
?>
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>Reaction Scenario Drill-down</title>
		<link rel="stylesheet" type="text/css" href="include/css/bootstrap.css">
		<link rel="stylesheet" type="text/css" href="include/css/toolkit.css">
開發者ID:Covert-Inferno,項目名稱:reaction-toolkit,代碼行數:31,代碼來源:scenario.php

示例2: chdir

<?php

chdir(__DIR__);
while (!file_exists('include/config/config.php')) {
    chdir('..');
}
include_once 'include/config/config.php';
$dbMgr = new DatabaseManager(false);
$twoDaysAgo = $dbMgr->getLastTimestamp(time() - 172800, 86400);
$yesterday = $dbMgr->getLastTimestamp(time() - 86400, 86400);
$dbMgr->processDailyHistoricalPrices($yesterday);
$dbMgr->deletePriceData($twoDaysAgo);
開發者ID:Covert-Inferno,項目名稱:reaction-toolkit,代碼行數:12,代碼來源:process_historical_prices.php

示例3: microtime

<?php

require_once 'include/session_setup.php';
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;
$scriptName = basename($_SERVER['PHP_SELF']);
$options = array("r" => $_SESSION['params']['r'], "s" => $_SESSION['params']['s'], "g" => $_SESSION['params']['g'], "sy" => $_SESSION['params']['sy'], "i" => $_SESSION['params']['i'], "f" => $_SESSION['params']['f'], "o" => $_SESSION['params']['o'], "t" => $_SESSION['params']['t']);
$dbMgr = new DatabaseManager(true);
$objectFactory = new ObjectFactory();
$formBuilder = new FormBuilder();
$datetime = $dbMgr->getLastTimestamp(time(), 300);
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <?php 
if (isset($argArray['configure'])) {
    echo "<title>Reaction Toolkit Configuration</title>";
} else {
    echo "<title>Reaction Toolkit Dashboard</title>";
}
?>
        <link rel="stylesheet" type="text/css" href="include/css/bootstrap.css">
        <link rel="stylesheet" type="text/css" href="include/css/toolkit.css">
        <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js"></script>
        <script type="text/javascript">
開發者ID:Covert-Inferno,項目名稱:reaction-toolkit,代碼行數:31,代碼來源:dashboard.php

示例4: chdir

<?php

chdir(__DIR__);
while (!file_exists('include/config/config.php')) {
    chdir('..');
}
require_once 'include/config/config.php';
$filePath = __DIR__;
$statusFile = "{$filePath}/../include/pages/price_update.txt";
$status = "";
$dbMgr = new DatabaseManager(false);
$api = new MarketAPI();
$source = $api->updatePrices();
if ($source !== false) {
    $status = "Prices updated successfully from {$source} as of " . $dbMgr->getLastTimestamp(time()) . " EVE time (UTC).";
} else {
    $status = "Last price update failed.  Oops.";
}
file_put_contents($statusFile, $status);
開發者ID:Covert-Inferno,項目名稱:reaction-toolkit,代碼行數:19,代碼來源:update_prices.php

示例5: array

         $numCycles = $dbMgr->getNumCycles($_SESSION['params']['t']);
         break;
     case "w":
         $timeframeStr = "Weekly";
         $numCycles = $dbMgr->getNumCycles($_SESSION['params']['t']);
         break;
     case "m":
         $timeframeStr = "Monthly";
         $numCycles = $dbMgr->getNumCycles($_SESSION['params']['t']);
         break;
 }
 $numCycles = $dbMgr->getNumCycles($_SESSION['params']['t']);
 $graphTitle = "{$itemName} {$chainStr} Historical {$timeframeStr} Net Income";
 $historicalData = array();
 for ($x = 0; $x < $numResults; $x++) {
     $datetime = $dbMgr->getLastTimestamp(time() - $modulo * $x, $modulo);
     switch ($_SESSION['params']['rn']) {
         case "d":
             $datetime = $dbMgr->getLastTimestamp(time() - $modulo * $x, $modulo);
             break;
         case "m":
             $datetime = date("Y-m-d", strtotime($datetime));
             break;
         case "y":
             $datetime = date("F Y", strtotime($datetime));
             break;
     }
     $calc = new Calculator($reactionID, $chain, $datetime);
     $netIncome = $calc->getHourlyNetIncome() * $numCycles;
     $historicalData[$datetime] = $netIncome;
 }
開發者ID:Covert-Inferno,項目名稱:reaction-toolkit,代碼行數:31,代碼來源:history.php


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