本文整理汇总了PHP中AdminPage::run_api方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminPage::run_api方法的具体用法?PHP AdminPage::run_api怎么用?PHP AdminPage::run_api使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminPage
的用法示例。
在下文中一共展示了AdminPage::run_api方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
/**
* Reason 4 Beta 8 adds a setting DISABLE_REASON_ADMINISTRATIVE_INTERFACE, which is more specific than DISABLE_REASON_LOGIN,
* and gets used if it is defined.
*/
if (defined('DISABLE_REASON_ADMINISTRATIVE_INTERFACE') ? DISABLE_REASON_ADMINISTRATIVE_INTERFACE : DISABLE_REASON_LOGIN) {
header('Location: /errors/maintenance.php');
//?estimate='.$maintenance_estimate );
die;
}
$f = new AdminPage();
$authenticated = $f->authenticate();
if ($authenticated) {
$f->init();
// init returns false if the user cannot be authentication
if ($f->should_run_api()) {
$f->run_api();
exit;
} else {
$f->run();
}
} else {
if (reason_unique_name_exists('unauthorized_reason_user')) {
$e = new entity(id_of('unauthorized_reason_user'));
echo $e->get_value('content');
} else {
echo '<p>We\'re sorry, but we do not have any record of you being an authorized Reason user.</p>';
}
}
$_page_timing_end = getmicrotime();
$page_gen_time = round(1000 * ($_page_timing_end - $_page_timing_start), 0);
echo '<!-- start time: ' . $_page_timing_start . ' end time: ' . $_page_timing_end . ' total time: ' . $page_gen_time . ' ms -->';