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


PHP min_enable_zlib_compression函数代码示例

本文整理汇总了PHP中min_enable_zlib_compression函数的典型用法代码示例。如果您正苦于以下问题:PHP min_enable_zlib_compression函数的具体用法?PHP min_enable_zlib_compression怎么用?PHP min_enable_zlib_compression使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: js_send_cached

/**
 * Send javascript file content with as much caching as possible
 * @param string $jspath
 * @param string $etag
 * @param string $filename
 */
function js_send_cached($jspath, $etag, $filename = 'javascript.php') {
    require(__DIR__ . '/xsendfilelib.php');

    $lifetime = 60*60*24*60; // 60 days only - the revision may get incremented quite often

    header('Etag: "'.$etag.'"');
    header('Content-Disposition: inline; filename="'.$filename.'"');
    header('Last-Modified: '. gmdate('D, d M Y H:i:s', filemtime($jspath)) .' GMT');
    header('Expires: '. gmdate('D, d M Y H:i:s', time() + $lifetime) .' GMT');
    header('Pragma: ');
    header('Cache-Control: public, max-age='.$lifetime);
    header('Accept-Ranges: none');
    header('Content-Type: application/javascript; charset=utf-8');

    if (xsendfile($jspath)) {
        die;
    }

    if (!min_enable_zlib_compression()) {
        header('Content-Length: '.filesize($jspath));
    }

    readfile($jspath);
    die;
}
开发者ID:ncsu-delta,项目名称:moodle,代码行数:31,代码来源:jslib.php

示例2: combo_send_uncached

/**
 * Send the JavaScript uncached
 * @param string $content
 * @param string $mimetype
 */
function combo_send_uncached($content, $mimetype)
{
    header('Content-Disposition: inline; filename="combo"');
    header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
    header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 2) . ' GMT');
    header('Pragma: ');
    header('Accept-Ranges: none');
    header('Content-Type: ' . $mimetype);
    if (!min_enable_zlib_compression()) {
        header('Content-Length: ' . strlen($content));
    }
    echo $content;
    die;
}
开发者ID:esyacelga,项目名称:sisadmaca,代码行数:19,代码来源:yui_combo.php

示例3: header

header('Etag: '.$etag);
header('Content-Disposition: inline; filename="'.$filename.'"');
header('Last-Modified: '. gmdate('D, d M Y H:i:s', filemtime($file)) .' GMT');
header('Expires: '. gmdate('D, d M Y H:i:s', time() + $lifetime) .' GMT');
header('Pragma: ');
header('Cache-Control: public, max-age='.$lifetime);
header('Accept-Ranges: none');
header('Content-Type: '.$mimetype);

if (xsendfile($file)) {
    die;
}

if ($mimetype === 'text/css' or $mimetype === 'application/javascript') {
    if (!min_enable_zlib_compression()) {
        header('Content-Length: '.filesize($file));
    }
} else {
    // No need to compress images.
    header('Content-Length: '.filesize($file));
}

readfile($file);
die;



function jquery_file_not_found() {
    // Note: we can not disclose the exact file path here, sorry.
    header('HTTP/1.0 404 not found');
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:30,代码来源:jquery.php

示例4: send_cached_js

function send_cached_js($jspath) {
    $lifetime = 60*60*24*30; // 30 days

    header('Content-Disposition: inline; filename="javascript.php"');
    header('Last-Modified: '. gmdate('D, d M Y H:i:s', filemtime($jspath)) .' GMT');
    header('Expires: '. gmdate('D, d M Y H:i:s', time() + $lifetime) .' GMT');
    header('Pragma: ');
    header('Cache-Control: max-age='.$lifetime);
    header('Accept-Ranges: none');
    header('Content-Type: application/javascript; charset=utf-8');
    if (!min_enable_zlib_compression()) {
        header('Content-Length: '.filesize($jspath));
    }

    readfile($jspath);
    die;
}
开发者ID:numbas,项目名称:moodle,代码行数:17,代码来源:javascript.php

示例5: theme_essential_send_cached_css

function theme_essential_send_cached_css($path, $filename, $lastmodified, $etag)
{
    global $CFG;
    require_once $CFG->dirroot . '/lib/configonlylib.php';
    // For min_enable_zlib_compression().
    // 60 days only - the revision may get incremented quite often.
    $lifetime = 60 * 60 * 24 * 60;
    header('Etag: "' . $etag . '"');
    header('Content-Disposition: inline; filename="' . $filename . '"');
    if ($lastmodified) {
        header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $lastmodified) . ' GMT');
    }
    header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $lifetime) . ' GMT');
    header('Pragma: ');
    header('Cache-Control: public, max-age=' . $lifetime);
    header('Accept-Ranges: none');
    header('Content-Type: text/css; charset=utf-8');
    if (!min_enable_zlib_compression()) {
        header('Content-Length: ' . filesize($path . $filename));
    }
    readfile($path . $filename);
    die;
}
开发者ID:nadavkav,项目名称:moodle-accessibility,代码行数:23,代码来源:lib.php

示例6: css_send_cached_css

/**
 * Sends a cached CSS file
 *
 * This function sends the cached CSS file. Remember it is generated on the first
 * request, then optimised/minified, and finally cached for serving.
 *
 * @param string $csspath The path to the CSS file we want to serve.
 * @param string $etag The revision to make sure we utilise any caches.
 */
function css_send_cached_css($csspath, $etag)
{
    $lifetime = 60 * 60 * 24 * 60;
    // 60 days only - the revision may get incremented quite often
    header('Etag: "' . $etag . '"');
    header('Content-Disposition: inline; filename="styles.php"');
    header('Last-Modified: ' . gmdate('D, d M Y H:i:s', filemtime($csspath)) . ' GMT');
    header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $lifetime) . ' GMT');
    header('Pragma: ');
    header('Cache-Control: public, max-age=' . $lifetime);
    header('Accept-Ranges: none');
    header('Content-Type: text/css; charset=utf-8');
    if (!min_enable_zlib_compression()) {
        header('Content-Length: ' . filesize($csspath));
    }
    readfile($csspath);
    die;
}
开发者ID:masaterutakeno,项目名称:MoodleMobile,代码行数:27,代码来源:csslib.php

示例7: send_cached_css

function send_cached_css($csspath, $rev)
{
    $lifetime = 60 * 60 * 24 * 20;
    header('Content-Disposition: inline; filename="styles.php"');
    header('Last-Modified: ' . gmdate('D, d M Y H:i:s', filemtime($csspath)) . ' GMT');
    header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $lifetime) . ' GMT');
    header('Pragma: ');
    header('Accept-Ranges: none');
    header('Content-Type: text/css; charset=utf-8');
    if (!min_enable_zlib_compression()) {
        header('Content-Length: ' . filesize($csspath));
    }
    readfile($csspath);
    die;
}
开发者ID:sebastiansanio,项目名称:tallerdeprogramacion2fiuba,代码行数:15,代码来源:styles.php


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