當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BigTree::formatCSS3方法代碼示例

本文整理匯總了PHP中BigTree::formatCSS3方法的典型用法代碼示例。如果您正苦於以下問題:PHP BigTree::formatCSS3方法的具體用法?PHP BigTree::formatCSS3怎麽用?PHP BigTree::formatCSS3使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BigTree的用法示例。


在下文中一共展示了BigTree::formatCSS3方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: lessc

 if (is_array($bigtree["config"]["css"]["files"][$css_file])) {
     // if we need LESS
     if (strpos(implode(" ", $bigtree["config"]["css"]["files"][$css_file]), "less") > -1) {
         $less_compiler = new lessc();
         $less_compiler->setImportDir(array(SITE_ROOT . "css/"));
     }
     foreach ($bigtree["config"]["css"]["files"][$css_file] as $style_file) {
         $style = file_get_contents(SITE_ROOT . "css/{$style_file}");
         if (strpos($style_file, "less") > -1) {
             // convert LESS
             $style = $less_compiler->compile($style);
         } else {
             // normal CSS
             if ($bigtree["config"]["css"]["prefix"]) {
                 // Replace CSS3 easymode
                 $style = BigTree::formatCSS3($style);
             }
         }
         $data .= $style . "\n";
     }
 }
 // Should only loop once, not with every file
 if (is_array($bigtree["config"]["css"]["vars"])) {
     foreach ($bigtree["config"]["css"]["vars"] as $key => $val) {
         $data = str_replace('$' . $key, $val, $data);
     }
 }
 // Replace roots
 $data = str_replace(array('$www_root', 'www_root/', '$static_root', 'static_root/', '$admin_root/', 'admin_root/'), array(WWW_ROOT, WWW_ROOT, STATIC_ROOT, STATIC_ROOT, ADMIN_ROOT, ADMIN_ROOT), $data);
 if ($bigtree["config"]["css"]["minify"]) {
     $minifier = new CSSMin();
開發者ID:kalle0045,項目名稱:BigTree-CMS,代碼行數:31,代碼來源:router.php

示例2: file_exists

    }
    $ifile = file_exists("../custom/admin/css/" . $ipath . $bigtree["path"][$x]) ? "../custom/admin/css/" . $ipath . $bigtree["path"][$x] : "../core/admin/css/" . $ipath . $bigtree["path"][$x];
    if (function_exists("apache_request_headers")) {
        $headers = apache_request_headers();
        $ims = isset($headers["If-Modified-Since"]) ? $headers["If-Modified-Since"] : "";
    } else {
        $ims = isset($_SERVER["HTTP_IF_MODIFIED_SINCE"]) ? $_SERVER["HTTP_IF_MODIFIED_SINCE"] : "";
    }
    $last_modified = filemtime($ifile);
    if ($ims && strtotime($ims) == $last_modified) {
        header("Last-Modified: " . gmdate("D, d M Y H:i:s", $last_modified) . ' GMT', true, 304);
        die;
    }
    header("Content-type: text/css");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s", $last_modified) . ' GMT', true, 200);
    echo BigTree::formatCSS3(str_replace("admin_root/", $bigtree["config"]["admin_root"], file_get_contents($ifile)));
    die;
}
// JavaScript
if ($bigtree["path"][1] == "js") {
    $pms = ini_get('post_max_size');
    $mul = substr($pms, -1);
    $mul = $mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1));
    $max_file_size = $mul * (int) $pms;
    $x = 2;
    $ipath = "";
    while ($x < count($bigtree["path"]) - 1) {
        $ipath .= $bigtree["path"][$x] . "/";
        $x++;
    }
    $ifile = file_exists("../custom/admin/js/" . $ipath . $bigtree["path"][$x]) ? "../custom/admin/js/" . $ipath . $bigtree["path"][$x] : "../core/admin/js/" . $ipath . $bigtree["path"][$x];
開發者ID:matthisamoto,項目名稱:Graphfan,代碼行數:31,代碼來源:router.php

示例3: file_exists

        $css_file = file_exists("../custom/admin/css/{$css_path}") ? "../custom/admin/css/{$css_path}" : "../core/admin/css/{$css_path}";
    }
    if (function_exists("apache_request_headers")) {
        $headers = apache_request_headers();
        $ims = isset($headers["If-Modified-Since"]) ? $headers["If-Modified-Since"] : "";
    } else {
        $ims = isset($_SERVER["HTTP_IF_MODIFIED_SINCE"]) ? $_SERVER["HTTP_IF_MODIFIED_SINCE"] : "";
    }
    $last_modified = filemtime($css_file);
    if ($ims && strtotime($ims) == $last_modified) {
        header("Last-Modified: " . gmdate("D, d M Y H:i:s", $last_modified) . ' GMT', true, 304);
        die;
    }
    header("Content-type: text/css");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s", $last_modified) . ' GMT', true, 200);
    die(BigTree::formatCSS3(file_get_contents($css_file)));
}
// JavaScript
if ($bigtree["path"][1] == "js") {
    // Calcuate the maximum post size so we can pass it along to scripts
    $pms = ini_get('post_max_size');
    $mul = substr($pms, -1);
    $mul = $mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1));
    $max_file_size = $mul * (int) $pms;
    $js_path = implode("/", array_slice($bigtree["path"], 2));
    if (defined("EXTENSION_ROOT")) {
        $js_file = EXTENSION_ROOT . "js/{$js_path}";
    } else {
        $js_file = file_exists("../custom/admin/js/{$js_path}") ? "../custom/admin/js/{$js_path}" : "../core/admin/js/{$js_path}";
    }
    // If we're serving php, just include it instead of trying to parse it as JS
開發者ID:kurt-planet,項目名稱:BigTree-CMS,代碼行數:31,代碼來源:router.php


注:本文中的BigTree::formatCSS3方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。