本文整理汇总了PHP中Booster::getfilestime方法的典型用法代码示例。如果您正苦于以下问题:PHP Booster::getfilestime方法的具体用法?PHP Booster::getfilestime怎么用?PHP Booster::getfilestime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Booster
的用法示例。
在下文中一共展示了Booster::getfilestime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: booster_wp
//.........这里部分代码省略.........
// Calculate relative path from Booster to file
$booster_to_file_path = $booster->getpath(str_replace('\\', '/', dirname($filename)), str_replace('\\', '/', dirname(__FILE__)));
$filename = $booster_to_file_path . '/' . basename($filename);
// Create sub-arrays if not yet there
if (!isset($css_rel_files[$media])) {
$css_rel_files[$media] = array();
}
if (!isset($css_abs_files[$media])) {
$css_abs_files[$media] = array();
}
if (!isset($css_rel_files[$media][$rel])) {
$css_rel_files[$media][$rel] = array();
}
if (!isset($css_abs_files[$media][$rel])) {
$css_abs_files[$media][$rel] = array();
}
// Enqueue file to respective array
array_push($css_rel_files[$media][$rel], $filename);
array_push($css_abs_files[$media][$rel], rtrim(str_replace('\\', '/', dirname(realpath(ABSPATH))), '/') . '/' . $root_to_booster_path . '/' . $filename);
} else {
$out = str_replace($treffer[0][$i], $treffer[0][$i] . '<!-- Booster skipped ' . $filename . ' -->', $out);
}
} else {
$out = str_replace($treffer[0][$i], $treffer[0][$i] . '<!-- Booster had a problems finding ' . $filename . ' -->', $out);
}
}
// Creating Booster markup for each media and relation seperately
reset($css_rel_files);
for ($i = 0; $i < count($css_rel_files); $i++) {
$media_rel = $css_rel_files[key($css_rel_files)];
$media_abs = $css_abs_files[key($css_rel_files)];
reset($media_rel);
for ($j = 0; $j < count($media_rel); $j++) {
$booster->getfilestime($media_rel[key($media_rel)], 'css');
$media_rel[key($media_rel)] = implode(',', $media_rel[key($media_rel)]);
$media_abs[key($media_rel)] = implode(',', $media_abs[key($media_rel)]);
$link = '<link type="text/css" rel="' . key($media_rel) . '" media="' . key($css_rel_files) . '" href="' . get_option('siteurl') . '/wp-content/plugins/' . $booster_folder . '/booster_css.php/dir=' . htmlentities(str_replace('..', '%3E', $media_rel[key($media_rel)])) . '&cachedir=' . htmlentities(str_replace('..', '%3E', $booster_cache_reldir), ENT_QUOTES) . ($booster->debug ? '&debug=1' : '') . ($booster->librarydebug ? '&librarydebug=1' : '') . '&nocache=' . $booster->filestime . '" />';
if (key($css_rel_files) != 'print') {
$booster_out .= $link . "\r\n";
} else {
$booster_out .= '<noscript>' . $link . '</noscript>' . "\r\n";
$js_plain .= 'jQuery(document).ready(function () {
jQuery("head").append("' . addslashes($link) . '");
});
';
}
$booster_out .= "\r\n";
#$booster_out .= "\r\n<!-- ".$media_abs[key($media_rel)]." -->\r\n";
next($media_rel);
}
next($css_rel_files);
}
// Injecting the result
$out = str_replace('</title>', "</title>\r\n<meta name=\"booster_cache_dir\" content=\"" . BOOSTER_CACHE_DIR . "\" />\r\n" . $booster_out, $out);
$booster_out = '';
// JS-part
$js_rel_files = array();
$js_abs_files = array();
preg_match_all('/<script[^>]*>(.*?)<\\/script>/ims', $headtreffer[0][0], $treffer, PREG_PATTERN_ORDER);
for ($i = 0; $i < count($treffer[0]); $i++) {
if (preg_match('/<script.*?src=[\'"]*([^\'"]+\\.js)[\'"]*.*?<\\/script>/ims', $treffer[0][$i], $srctreffer)) {
// Get Domainname
if (isset($_SERVER['SCRIPT_URI'])) {
$host = parse_url($_SERVER['SCRIPT_URI'], PHP_URL_HOST);
} else {
$host = $_SERVER['HTTP_HOST'];