CoreFiles by mySites.guru
factory.php63 lines, 1,568 bytes, from Joomla_3.8.2-Stable-Full_Package.zip
Raw History Compare with 3.8.1
md5
fde0cfcb1229bd8194ee08090a003441
sha1
79819399a4e34584c9270f5097a2df77cbed6952
sha256
68bdd98a8fd14c32db69eae1fb7de136afc003934af7eacb5dcd6e1dc36718f0
<?php
/**
 * @package     Joomla.Legacy
 * @subpackage  Simplepie
 *
 * @copyright   Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

jimport('simplepie.simplepie');

/**
 * Class to maintain a pathway.
 *
 * The user's navigated path within the application.
 *
 * @since       3.0
 * @deprecated  3.0 Use JFeed or supply your own methods
 */
class JSimplepieFactory
{
	/**
	 * Get a parsed XML Feed Source
	 *
	 * @param   string   $url         URL for feed source.
	 * @param   integer  $cache_time  Time to cache feed for (using internal cache mechanism).
	 *
	 * @return  SimplePie|boolean  SimplePie parsed object on success, false on failure.
	 *
	 * @since   3.0
	 * @deprecated  3.0  Use JFeedFactory($url) instead.
	 */
	public static function getFeedParser($url, $cache_time = 0)
	{
		JLog::add(__METHOD__ . ' is deprecated.   Use JFeedFactory() or supply Simple Pie instead.', JLog::WARNING, 'deprecated');

		$cache = JFactory::getCache('feed_parser', 'callback');

		if ($cache_time > 0)
		{
			$cache->setLifeTime($cache_time);
		}

		$simplepie = new SimplePie(null, null, 0);

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

		$contents = $cache->get(array($simplepie, 'init'), null, false, false);

		if ($contents)
		{
			return $simplepie;
		}

		JLog::add(JText::_('JLIB_UTIL_ERROR_LOADING_FEED_DATA'), JLog::WARNING, 'jerror');

		return false;
	}
}

The same content is in 20 releases, Joomla 3.7.3-beta1 to 3.8.3. See them all, or every version of this file.