当前位置: 首页>>代码示例>>PHP>>正文


PHP http::expire方法代码示例

本文整理汇总了PHP中http::expire方法的典型用法代码示例。如果您正苦于以下问题:PHP http::expire方法的具体用法?PHP http::expire怎么用?PHP http::expire使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在http的用法示例。


在下文中一共展示了http::expire方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: render_raw

        $text = @$result[1];
        // save in cache for the next request
        Cache::put($cache_id, $text, 'articles');
    }
    //
    // transfer to the user agent
    //
    // handle the output correctly
    render_raw('text/xml; charset=' . $context['charset']);
    // suggest a name on download
    if (!headers_sent()) {
        $file_name = utf8::to_ascii($context['site_name'] . '.section.' . $item['id'] . '.rss.xml');
        Safe::header('Content-Disposition: inline; filename="' . str_replace('"', '', $file_name) . '"');
    }
    // enable 30-minute caching (30*60 = 1800), even through https, to help IE6 on download
    http::expire(1800);
    // strong validator
    $etag = '"' . md5($text) . '"';
    // manage web cache
    if (http::validate(NULL, $etag)) {
        return;
    }
    // actual transmission except on a HEAD request
    if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] != 'HEAD') {
        echo $text;
    }
    // the post-processing hook, then exit
    finalize_page(TRUE);
}
// render the skin
render_skin();
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:feed.php

示例2: die

 *
 * This script is also used to refresh session data. This is an effective way
 * to preserve idle sessions at some rough ISP.
 *
 * Accept following invocations:
 * - heartbit.php
 *
 * @author Bernard Paques
 * @reference
 * @license http://www.gnu.org/copyleft/lesser.txt GNU Lesser General Public License
 */
// common definitions and initial processing
include_once '../shared/global.php';
include_once 'notifications.php';
// ensure browser always look for fresh data
http::expire(0);
// surfer has to be logged --provide a short response
if (!Surfer::get_id()) {
    Safe::header('Status: 401 Unauthorized', TRUE, 401);
    die(i18n::s('You are not allowed to perform this operation.'));
    // a new notification has been submitted
} elseif (isset($_REQUEST['recipient']) && isset($_REQUEST['type'])) {
    // record the notification
    $fields = array();
    $fields['nick_name'] = Surfer::get_name();
    $fields['recipient'] = $_REQUEST['recipient'];
    $fields['type'] = $_REQUEST['type'];
    if (isset($_REQUEST['address'])) {
        $fields['address'] = encode_link($_REQUEST['address']);
    }
    if (isset($_REQUEST['message'])) {
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:heartbit.php


注:本文中的http::expire方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。