Пример #1
0
 public function setup()
 {
     Zend_Feed_Reader::reset();
     if (Zend_Registry::isRegistered('Zend_Locale')) {
         $registry = Zend_Registry::getInstance();
         unset($registry['Zend_Locale']);
     }
     $this->_feedSamplePath = dirname(__FILE__) . '/_files/Common';
 }
 public function setup()
 {
     Zend_Feed_Reader::reset();
     $this->_feedSamplePath = dirname(__FILE__) . '/_files/h-online.com-atom10.xml';
     $this->_options = Zend_Date::setOptions();
     foreach ($this->_options as $k => $v) {
         if (is_null($v)) {
             unset($this->_options[$k]);
         }
     }
     Zend_Date::setOptions(array('format_type' => 'iso'));
 }
 public function setup()
 {
     Zend_Feed_Reader::reset();
     if (Zend_Registry::isRegistered('Zend_Locale')) {
         $registry = Zend_Registry::getInstance();
         unset($registry['Zend_Locale']);
     }
     $this->_feedSamplePath = dirname(__FILE__) . '/_files/AtomSource';
     $this->_options = Zend_Date::setOptions();
     foreach ($this->_options as $k => $v) {
         if (is_null($v)) {
             unset($this->_options[$k]);
         }
     }
     Zend_Date::setOptions(array('format_type' => 'iso'));
     $this->_expectedCats = array(array('term' => 'topic1', 'scheme' => 'http://example.com/schema1', 'label' => 'topic1'), array('term' => 'topic1', 'scheme' => 'http://example.com/schema2', 'label' => 'topic1'), array('term' => 'cat_dog', 'scheme' => 'http://example.com/schema1', 'label' => 'Cat & Dog'));
     $this->_expectedCatsDc = array(array('term' => 'topic1', 'scheme' => null, 'label' => 'topic1'), array('term' => 'topic2', 'scheme' => null, 'label' => 'topic2'));
 }
 public function tearDown()
 {
     Zend_Feed_Reader::reset();
 }
 public function setup()
 {
     Zend_Feed_Reader::reset();
     $this->_feedSamplePath = dirname(__FILE__) . '/_files/wordpress-rss2-dc-atom.xml';
 }
Пример #6
0
 private static function _processResources(array $config)
 {
     if (self::$_lock) {
         /**
          * @see Conjoon_Log
          */
         require_once 'Conjoon/Log.php';
         Conjoon_Log::log("Conjoon_Modules_Groupware_Feeds_ImportHelper::_processResources " . "- possible race condition", Zend_Log::INFO);
     }
     self::$_lock = true;
     $uri = $config['uri'];
     $requestTimeout = $config['requestTimeout'];
     $useCache = $config['useCache'];
     $useConditionalGet = $config['useConditionalGet'];
     $callback = $config['callback'];
     /**
      * @see Zend_Feed_Reader
      */
     require_once 'Zend/Feed/Reader.php';
     if ($useCache !== false) {
         // set the reader's cache here
         /**
          * @see Conjoon_Cache_Factory
          */
         require_once 'Conjoon/Cache/Factory.php';
         /**
          * @see Conjoon_Keys
          */
         require_once 'Conjoon/Keys.php';
         $frCache = Conjoon_Cache_Factory::getCache(Conjoon_Keys::CACHE_FEED_READER, Zend_Registry::get(Conjoon_Keys::REGISTRY_CONFIG_OBJECT)->toArray());
         if ($frCache) {
             Zend_Feed_Reader::setCache($frCache);
             if ($useConditionalGet !== false) {
                 Zend_Feed_Reader::useHttpConditionalGet();
             }
         }
     }
     Zend_Feed_Reader::getHttpClient()->setConfig(array('timeout' => $requestTimeout));
     $result = self::$callback($uri);
     Zend_Feed_Reader::reset();
     self::$_lock = false;
     return $result;
 }