MDL-19698 Fixing regression caused by new SimplePie
authorMartin Dougiamas <martin@moodle.com>
Wed, 21 Jul 2010 05:17:06 +0000 (05:17 +0000)
committerMartin Dougiamas <martin@moodle.com>
Wed, 21 Jul 2010 05:17:06 +0000 (05:17 +0000)
lib/simplepie/moodle_simplepie.php

index deef6c5..2ab4ff6 100644 (file)
@@ -62,7 +62,7 @@ class moodle_simplepie extends SimplePie
         $cachedir = moodle_simplepie::get_cache_directory();
         check_dir_exists($cachedir, true, true);
 
-        parent::__construct(null, $cachedir);
+        parent::__construct();
         // Match moodle encoding
         $this->set_output_encoding('UTF-8');
 
@@ -70,12 +70,13 @@ class moodle_simplepie extends SimplePie
         $this->set_timeout(2);
 
         // 1 hour default cache
+        $this->set_cache_location($cachedir);
         $this->set_cache_duration(3600);
 
         // init the feed url if passed in constructor
         if ($feedurl !== null) {
-                $this->set_feed_url($feedurl);
-                $this->init();
+            $this->set_feed_url($feedurl);
+            $this->init();
         }
     }