Source for file factory.php

Documentation is available at factory.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Legacy
  4.  * @subpackage  Simplepie
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE
  8.  */
  9.  
  10. defined('JPATH_PLATFORM'or die;
  11.  
  12. jimport('simplepie.simplepie');
  13.  
  14. /**
  15.  * Class to maintain a pathway.
  16.  *
  17.  * The user's navigated path within the application.
  18.  *
  19.  * @package     Joomla.Legacy
  20.  * @subpackage  Simplepie
  21.  * @since       12.2
  22.  * @deprecated  12.3 (Platform) & 4.0 (CMS) - Use JFeed or supply your own methods
  23.  */
  24. {
  25.     /**
  26.      * Get a parsed XML Feed Source
  27.      *
  28.      * @param   string   $url         Url for feed source.
  29.      * @param   integer  $cache_time  Time to cache feed for (using internal cache mechanism).
  30.      *
  31.      * @return  mixed  SimplePie parsed object on success, false on failure.
  32.      *
  33.      * @since   12.2
  34.      * @deprecated  4.0   Use JFeedFactory($url) instead.
  35.      *
  36.      * @note  In 3.2 will be proxied to JFeedFactory()
  37.      */
  38.     public static function getFeedParser($url$cache_time 0)
  39.     {
  40.         JLog::add(__METHOD__ . ' is deprecated.   Use JFeedFactory() or supply Simple Pie instead.'JLog::WARNING'deprecated');
  41.  
  42.         $cache JFactory::getCache('feed_parser''callback');
  43.  
  44.         if ($cache_time 0)
  45.         {
  46.             $cache->setLifeTime($cache_time);
  47.         }
  48.  
  49.         $simplepie new SimplePie(nullnull0);
  50.  
  51.         $simplepie->enable_cache(false);
  52.         $simplepie->set_feed_url($url);
  53.         $simplepie->force_feed(true);
  54.  
  55.         $contents $cache->get(array($simplepie'init')nullfalsefalse);
  56.  
  57.         if ($contents)
  58.         {
  59.             return $simplepie;
  60.         }
  61.  
  62.         JLog::add(JText::_('JLIB_UTIL_ERROR_LOADING_FEED_DATA')JLog::WARNING'jerror');
  63.  
  64.         return false;
  65.     }
  66. }

Documentation generated on Tue, 19 Nov 2013 15:02:49 +0100 by phpDocumentor 1.4.3