本文整理汇总了PHP中RSS::is_in_cache方法的典型用法代码示例。如果您正苦于以下问题:PHP RSS::is_in_cache方法的具体用法?PHP RSS::is_in_cache怎么用?PHP RSS::is_in_cache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RSS
的用法示例。
在下文中一共展示了RSS::is_in_cache方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute(HTTPRequestCustom $request)
{
$module_id = $request->get_getstring('module_id', '');
if (empty($module_id)) {
AppContext::get_response()->redirect(Environment::get_home_page());
}
$this->init();
$module_category_id = $request->get_getint('module_category_id', 0);
$feed_name = $request->get_getstring('feed_name', Feed::DEFAULT_FEED_NAME);
$feed = new RSS($module_id, $feed_name, $module_category_id);
if ($feed !== null && $feed->is_in_cache()) {
$this->tpl->put('SYNDICATION', $feed->read());
} else {
$eps = AppContext::get_extension_provider_service();
if ($eps->provider_exists($module_id, FeedProvider::EXTENSION_POINT)) {
$provider = $eps->get_provider($module_id);
$feeds = $provider->feeds();
$data = $feeds->get_feed_data_struct($module_category_id, $feed_name);
if ($data === null) {
AppContext::get_response()->set_header('content-type', 'text/html');
DispatchManager::redirect(PHPBoostErrors::unexisting_element());
} else {
$feed->load_data($data);
$feed->cache();
$this->tpl->put('SYNDICATION', $feed->export());
}
} else {
DispatchManager::redirect(PHPBoostErrors::module_not_installed());
}
}
return $this->build_response($this->tpl);
}
示例2: retrieve
$module_id = retrieve(GET, 'm', '');
if (!empty($module_id)) {
$feed_name = retrieve(GET, 'name', DEFAULT_FEED_NAME);
$category_id = retrieve(GET, 'cat', 0);
$feed = null;
switch (retrieve(GET, 'feed', 'rss')) {
case 'atom':
import('content/syndication/atom');
$feed = new ATOM($module_id, $feed_name, $category_id);
break;
default:
import('content/syndication/rss');
$feed = new RSS($module_id, $feed_name, $category_id);
break;
}
if ($feed != null && $feed->is_in_cache()) {
echo $feed->read();
} else {
import('modules/modules_discovery_service');
$modules_discovery_service = new ModulesDiscoveryService();
$module = $modules_discovery_service->get_module($module_id);
if (is_object($module) && $module->got_error() == 0 && $module->has_functionality('get_feed_data_struct')) {
$feed->load_data($module->get_feed_data_struct($category_id, $feed_name));
$feed->cache();
echo $feed->export();
} else {
redirect('member/error.php?e=e_uninstalled_module');
}
}
}
require_once PATH_TO_ROOT . '/kernel/footer_no_display.php';