本文整理匯總了PHP中Logs::GetPeriod方法的典型用法代碼示例。如果您正苦於以下問題:PHP Logs::GetPeriod方法的具體用法?PHP Logs::GetPeriod怎麽用?PHP Logs::GetPeriod使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Logs
的用法示例。
在下文中一共展示了Logs::GetPeriod方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: json_encode
$oRoute = explode('/', trim(UrlDecode($_SERVER['REQUEST_URI']), '/'));
if (count($oRoute) > 0) {
try {
$connection = new MongoClient();
switch ($oRoute[0]) {
case 'currency':
$app = new Currency($connection->Currency, $defaultCurrency, $oRoute[1], $oRoute[2]);
if ($app->Valid()) {
$result = $app->Calc();
$finish = microtime(true);
$app->Logger(array('request_date' => date('Y-m-d H:i:s'), 'request_time' => $finish - $start, 'request_price' => $app->cost, 'request_currency' => $app->fCurrency, 'request_ip' => $_SERVER['REMOTE_ADDR'], 'request_ua' => $_SERVER['HTTP_USER_AGENT']));
} else {
$result = array('error' => 1, 'mesage' => 'Запрос некорректен');
}
break;
case 'logs':
$app = new Logs($connection->Currency);
$result = $app->GetPeriod($oRoute[1], $oRoute[2]);
break;
default:
$result = array('error' => 1, 'mesage' => 'Запрос некорректен');
}
$connection->close();
} catch (MongoConnectionException $e) {
$result = array('error' => 1, 'mesage' => 'Сервис временно недоступен');
}
} else {
$result = array('error' => 1, 'mesage' => 'Запрос некорректен');
}
header('Content-type: application/json');
echo json_encode($result, false);