本文整理匯總了PHP中Flyspray::remote_request方法的典型用法代碼示例。如果您正苦於以下問題:PHP Flyspray::remote_request方法的具體用法?PHP Flyspray::remote_request怎麽用?PHP Flyspray::remote_request使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Flyspray
的用法示例。
在下文中一共展示了Flyspray::remote_request方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: show
function show($area = null)
{
global $page, $fs, $db, $proj, $user, $conf;
$perpage = '20';
if (isset($user->infos['tasks_perpage'])) {
$perpage = $user->infos['tasks_perpage'];
}
$pagenum = max(1, Get::num('pagenum', 1));
$offset = $perpage * ($pagenum - 1);
// Get the visibility state of all columns
$visible = explode(' ', trim($proj->id ? $proj->prefs['visible_columns'] : $fs->prefs['visible_columns']));
if (!is_array($visible) || !count($visible) || !$visible[0]) {
$visible = array('id');
}
list($tasks, $id_list) = Backend::get_task_list($_GET, $visible, $offset, $perpage);
$page->assign('tasks', $tasks);
$page->assign('offset', $offset);
$page->assign('perpage', $perpage);
$page->assign('pagenum', $pagenum);
$page->assign('visible', $visible);
// List of task IDs for next/previous links
$_SESSION['tasklist'] = $id_list;
$page->assign('total', count($id_list));
// Javascript replacement
if (Get::val('toggleadvanced')) {
$advanced_search = intval(!Req::val('advancedsearch'));
Flyspray::setCookie('advancedsearch', $advanced_search, time() + 60 * 60 * 24 * 30);
$_COOKIE['advancedsearch'] = $advanced_search;
}
// Update check {{{
if (Get::has('hideupdatemsg')) {
unset($_SESSION['latest_version']);
} else {
if ($conf['general']['update_check'] && $user->perms('is_admin') && $fs->prefs['last_update_check'] < time() - 60 * 60 * 24 * 3) {
if (!isset($_SESSION['latest_version'])) {
$latest = Flyspray::remote_request('http://flyspray.org/version.txt', GET_CONTENTS);
//if for some silly reason we get and empty response, we use the actual version
$_SESSION['latest_version'] = empty($latest) ? $fs->version : $latest;
$db->x->execParam('UPDATE {prefs} SET pref_value = ? WHERE pref_name = ?', array(time(), 'last_update_check'));
}
}
}
if (isset($_SESSION['latest_version']) && version_compare($fs->version, $_SESSION['latest_version'], '<')) {
$page->assign('updatemsg', true);
}
// }}}
$page->setTitle($fs->prefs['page_title'] . $proj->prefs['project_title'] . ': ' . L('tasklist'));
$page->pushTpl('index.tpl');
}
示例2: ob_clean
ob_clean();
flush();
// finally send out our data
printf("%s", $result);
}
// } }}
// Javascript replacement
if (Get::val('toggleadvanced')) {
$advanced_search = intval(!Req::val('advancedsearch'));
Flyspray::setCookie('advancedsearch', $advanced_search, time() + 60 * 60 * 24 * 30);
$_COOKIE['advancedsearch'] = $advanced_search;
}
// Update check {{{
if (Get::has('hideupdatemsg')) {
unset($_SESSION['latest_version']);
} else {
if ($conf['general']['update_check'] && $user->perms('is_admin') && $fs->prefs['last_update_check'] < time() - 60 * 60 * 24 * 3) {
if (!isset($_SESSION['latest_version'])) {
$latest = Flyspray::remote_request('http://flyspray.org/version.txt', GET_CONTENTS);
//if for some silly reason we get and empty response, we use the actual version
$_SESSION['latest_version'] = empty($latest) ? $fs->version : $latest;
$db->Query('UPDATE {prefs} SET pref_value = ? WHERE pref_name = ?', array(time(), 'last_update_check'));
}
}
}
if (isset($_SESSION['latest_version']) && version_compare($fs->version, $_SESSION['latest_version'], '<')) {
$page->assign('updatemsg', true);
}
// }}}
$page->setTitle($fs->prefs['page_title'] . $proj->prefs['project_title'] . ': ' . L('tasklist'));
$page->pushTpl('index.tpl');
示例3: startReminderDaemon
/**
* Starts the reminder daemon
* @access public static
* @return void
* @version 1.0
*/
function startReminderDaemon()
{
global $baseurl;
$runfile = Flyspray::get_tmp_dir() . '/flysprayreminders.run';
$timeout = 600;
if (!is_file($runfile) or filemtime($runfile) < time() - $timeout * 2) {
$include = 'schedule.php';
/* "localhost" is on **purpose** not a mistake ¡¡
* almost any server accepts requests to itself in localhost ;)
* firewalls will not block it.
* the "Host" http header will tell the webserver where flyspray is running.
*/
Flyspray::remote_request($baseurl . $include, !GET_CONTENTS, $_SERVER['SERVER_PORT'], 'localhost', $_SERVER['HTTP_HOST']);
}
}