本文整理汇总了PHP中http::cache方法的典型用法代码示例。如果您正苦于以下问题:PHP http::cache方法的具体用法?PHP http::cache怎么用?PHP http::cache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类http
的用法示例。
在下文中一共展示了http::cache方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rsd
public static function rsd($args)
{
$core =& $GLOBALS['core'];
http::cache($GLOBALS['mod_files'], $GLOBALS['mod_ts']);
header('Content-Type: text/xml; charset=UTF-8');
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd">' . "\n" . "<service>\n" . " <engineName>Dotclear</engineName>\n" . " <engineLink>http://www.dotclear.org/</engineLink>\n" . ' <homePageLink>' . html::escapeHTML($core->blog->url) . "</homePageLink>\n";
if ($core->blog->settings->enable_xmlrpc) {
$u = sprintf(DC_XMLRPC_URL, $core->blog->url, $core->blog->id);
echo " <apis>\n" . ' <api name="WordPress" blogID="1" preferred="true" apiLink="' . $u . '"/>' . "\n" . ' <api name="Movable Type" blogID="1" preferred="false" apiLink="' . $u . '"/>' . "\n" . ' <api name="MetaWeblog" blogID="1" preferred="false" apiLink="' . $u . '"/>' . "\n" . ' <api name="Blogger" blogID="1" preferred="false" apiLink="' . $u . '"/>' . "\n" . " </apis>\n";
}
echo "</service>\n" . "</rsd>\n";
}
示例2: dirname
# -- END LICENSE BLOCK -----------------------------------------
require dirname(__FILE__) . '/../inc/admin/prepend.php';
dcPage::check('admin');
# -- Loading themes --
$core->themes = new dcThemes($core);
$core->themes->loadModules($core->blog->themes_path, null);
# -- Page helper --
$list = new adminThemesList($core->themes, $core->blog->themes_path, $core->blog->settings->system->store_theme_url);
adminThemesList::$distributed_modules = explode(',', DC_DISTRIB_THEMES);
# -- Theme screenshot --
if (!empty($_GET['shot']) && $list->modules->moduleExists($_GET['shot'])) {
$f = path::real(empty($_GET['src']) ? $core->blog->themes_path . '/' . $_GET['shot'] . '/screenshot.jpg' : $core->blog->themes_path . '/' . $_GET['shot'] . '/' . path::clean($_GET['src']));
if (!file_exists($f)) {
$f = dirname(__FILE__) . '/images/noscreenshot.png';
}
http::cache(array_merge(array($f), get_included_files()));
header('Content-Type: ' . files::getMimeType($f));
header('Content-Length: ' . filesize($f));
readfile($f);
exit;
}
# -- Display module configuration page --
if ($list->setConfiguration($core->blog->settings->system->theme)) {
# Get content before page headers
include $list->includeConfiguration();
# Gather content
$list->getConfiguration();
# Display page
dcPage::open(__('Blog appearance'), dcPage::jsPageTabs() . dcPage::jsColorPicker() . $core->callBehavior('themesToolsHeaders', $core, true), dcPage::breadcrumb(array(html::escapeHTML($core->blog->name) => '', __('Blog appearance') => $list->getURL('', false), '<span class="page-title">' . __('Theme configuration') . '</span>' => '')));
# Display previously gathered content
$list->displayConfiguration();
示例3: xbel
public static function xbel($args)
{
$blogroll = new dcBlogroll($GLOBALS['core']->blog);
try {
$links = $blogroll->getLinks();
} catch (Exception $e) {
self::p404();
return;
}
if ($args) {
self::p404();
return;
}
http::cache($GLOBALS['mod_files'], $GLOBALS['mod_ts']);
header('Content-Type: text/xml; charset=UTF-8');
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<!DOCTYPE xbel PUBLIC "+//IDN python.org//DTD XML Bookmark Exchange ' . 'Language 1.0//EN//XML"' . "\n" . '"http://www.python.org/topics/xml/dtds/xbel-1.0.dtd">' . "\n" . '<xbel version="1.0">' . "\n" . '<title>' . html::escapeHTML($GLOBALS['core']->blog->name) . " blogroll</title>\n";
$i = 1;
foreach ($blogroll->getLinksHierarchy($links) as $cat_title => $links) {
if ($cat_title != '') {
echo '<folder>' . "\n" . "<title>" . html::escapeHTML($cat_title) . "</title>\n";
}
foreach ($links as $k => $v) {
$lang = $v['link_lang'] ? ' xml:lang="' . $v['link_lang'] . '"' : '';
echo '<bookmark href="' . $v['link_href'] . '"' . $lang . '>' . "\n" . '<title>' . html::escapeHTML($v['link_title']) . "</title>\n";
if ($v['link_desc']) {
echo '<desc>' . html::escapeHTML($v['link_desc']) . "</desc>\n";
}
if ($v['link_xfn']) {
echo "<info>\n" . '<metadata owner="http://gmpg.org/xfn/">' . $v['link_xfn'] . "</metadata>\n" . "</info>\n";
}
echo "</bookmark>\n";
}
if ($cat_title != '') {
echo "</folder>\n";
}
$i++;
}
echo '</xbel>';
}