本文整理汇总了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();
示例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];
示例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