本文整理汇总了PHP中log_timing函数的典型用法代码示例。如果您正苦于以下问题:PHP log_timing函数的具体用法?PHP log_timing怎么用?PHP log_timing使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了log_timing函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check_permission
try {
check_permission(PERM_ADDER);
if (!isset($_POST['sid']) || !isset($_POST['book_id'])) {
throw new UnexpectedValueException();
}
$sid = $_POST['sid'];
$book_id = $_POST['book_id'];
sql_begin();
//creating book if necessary
if ($book_id == -1) {
//find the parent id
$res = sql_pe("SELECT book_id, url FROM sources WHERE source_id = (SELECT parent_id FROM sources WHERE source_id=? LIMIT 1) LIMIT 1", array($sid));
if (!isset($_POST['book_name']) || !$res[0]['book_id']) {
throw new UnexpectedValueException();
}
$book_id = books_add($_POST['book_name'], $res[0]['book_id']);
$res = sql_pe("SELECT url FROM sources WHERE source_id=? LIMIT 1", array($sid));
books_add_tag($book_id, 'url:' . $res[0]['url']);
download_url($res[0]['url']);
}
//bind
sql_pe("UPDATE sources SET book_id=? WHERE source_id=? LIMIT 1", array($book_id, $sid));
sql_commit();
$res = sql_pe("SELECT book_name FROM books WHERE book_id=? LIMIT 1", array($book_id));
$result['title'] = htmlspecialchars($res[0]['book_name']);
$result['book_id'] = $book_id;
} catch (Exception $e) {
$result['error'] = 1;
}
log_timing(true);
die(json_encode($result));
示例2: revert_changeset
<?php
require 'lib/header.php';
require_once 'lib/lib_history.php';
if (isset($_POST['comment'])) {
$comment = $_POST['comment'];
} else {
$comment = '';
}
if (isset($_GET['set_id']) && ($set_id = $_GET['set_id'])) {
$r = revert_changeset($set_id, $comment);
header("Location:{$r}");
} elseif (isset($_GET['tf_rev']) && ($rev_id = $_GET['tf_rev'])) {
revert_token($rev_id);
header("Location:history.php");
} elseif (isset($_GET['dict_rev']) && ($rev_id = $_GET['dict_rev'])) {
revert_dict($rev_id);
header("Location:dict_history.php");
}
log_timing();