rss cache Joomla 2.5


Faced with an amazing bug in Joomla 2.5:
 
When importing news from third-party sites via rss, they first hang for a while, and then completely disappear. After an hour of wandering it became clear that the problem with the cache.
 
The treatment:
 
1) go to /libraries/joomla


2) Open the file factory.php in notepad
3) Look for function getFeedParse – starts on line ~345:
public static function getFeedParser($url, $cache_time = 0)
4) Replace the entire function with an expression:

public static function getFeedParser($url, $cache_time = 0)
{
jimport(‘simplepie.simplepie’);

$cache = self::getCache(‘feed_parser’, ”);

if($simplepie = $cache->get($url)){
return $simplepie;
}else{
$simplepie = new SimplePie(null, null, 0);

$simplepie->enable_cache(false);
$simplepie->set_feed_url($url);
$simplepie->force_feed(true);
$simplepie->init();

if ($cache_time > 0)
{
$cache->setLifeTime($cache_time);
$cache->store($simplepie, $url);
}

return $simplepie;
}
}
5) Enjoying life %)

I found the treatment here

As I understand it, the error is due to a crooked auto-update old versions of Joomla, so it is not so widespread.


This entry was posted in CMS (en), Joomla (en). Bookmark the permalink.

Leave a Reply

🇬🇧 Attention! Comments with URLs/email are not allowed.
🇷🇺 Комментарии со ссылками/email удаляются автоматически.