SimplePie::set_file PHP Method

set_file() public method

Set an instance of {@see SimplePie_File} to use as a feed
public set_file ( &$file ) : boolean
return boolean True on success, false on failure
    public function set_file(&$file)
    {
        if ($file instanceof SimplePie_File) {
            $this->feed_url = $file->url;
            $this->permanent_url = $this->feed_url;
            $this->file =& $file;
            return true;
        }
        return false;
    }

Usage Example

Example #1
0
 public function createSimplePieObject($fileName)
 {
     $filePath = self::calcFixtureFilePath($fileName);
     $feed = new SimplePie();
     $feed->set_file(new SimplePie_File($filePath));
     $feed->set_cache_location(sfConfig::get('sf_cache_dir'));
     if (!@$feed->init()) {
         return false;
     }
     return $feed;
 }
All Usage Examples Of SimplePie::set_file