From ec3972361d95f6f5956df77f7a76105b5ae6af72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sun, 25 Aug 2013 20:10:23 +0200 Subject: poche now uses Full Text RSS to fetch content --- inc/3rdparty/simplepie/SimplePie/Cache/File.php | 112 ++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 inc/3rdparty/simplepie/SimplePie/Cache/File.php (limited to 'inc/3rdparty/simplepie/SimplePie/Cache/File.php') diff --git a/inc/3rdparty/simplepie/SimplePie/Cache/File.php b/inc/3rdparty/simplepie/SimplePie/Cache/File.php new file mode 100644 index 00000000..f496ff50 --- /dev/null +++ b/inc/3rdparty/simplepie/SimplePie/Cache/File.php @@ -0,0 +1,112 @@ +location = $location; + $this->filename = $filename; + $this->extension = $extension; + $this->name = "$this->location/$this->filename.$this->extension"; + } + + public function save($data) + { + if (file_exists($this->name) && is_writeable($this->name) || file_exists($this->location) && is_writeable($this->location)) + { + if (is_a($data, 'SimplePie')) + { + $data = $data->data; + } + + $data = serialize($data); + return (bool) file_put_contents($this->name, $data); + } + return false; + } + + public function load() + { + if (file_exists($this->name) && is_readable($this->name)) + { + return unserialize(file_get_contents($this->name)); + } + return false; + } + + public function mtime() + { + if (file_exists($this->name)) + { + return filemtime($this->name); + } + return false; + } + + public function touch() + { + if (file_exists($this->name)) + { + return touch($this->name); + } + return false; + } + + public function unlink() + { + if (file_exists($this->name)) + { + return unlink($this->name); + } + return false; + } +} -- cgit v1.2.3