From 05fd3ebe1250ebb171645990c68b9d540dd8c0ce Mon Sep 17 00:00:00 2001 From: Alessandro Cosentino Date: Tue, 17 Jul 2012 15:24:26 -0400 Subject: replace simplepie-dev with simplepie-stable --- 3rdparty/SimplePie/LICENSE.txt | 26 - 3rdparty/SimplePie/SimplePie/Author.php | 156 - 3rdparty/SimplePie/SimplePie/Cache.php | 121 - 3rdparty/SimplePie/SimplePie/Cache/Base.php | 113 - 3rdparty/SimplePie/SimplePie/Cache/DB.php | 136 - 3rdparty/SimplePie/SimplePie/Cache/File.php | 172 -- 3rdparty/SimplePie/SimplePie/Cache/Memcache.php | 179 -- 3rdparty/SimplePie/SimplePie/Cache/MySQL.php | 437 --- 3rdparty/SimplePie/SimplePie/Caption.php | 209 -- 3rdparty/SimplePie/SimplePie/Category.php | 156 - .../SimplePie/SimplePie/Content/Type/Sniffer.php | 331 --- 3rdparty/SimplePie/SimplePie/Copyright.php | 129 - 3rdparty/SimplePie/SimplePie/Core.php | 2576 ----------------- 3rdparty/SimplePie/SimplePie/Credit.php | 155 - .../SimplePie/SimplePie/Decode/HTML/Entities.php | 250 -- 3rdparty/SimplePie/SimplePie/Enclosure.php | 1379 --------- 3rdparty/SimplePie/SimplePie/File.php | 291 -- 3rdparty/SimplePie/SimplePie/HTTP/Parser.php | 499 ---- 3rdparty/SimplePie/SimplePie/IRI.php | 996 ------- 3rdparty/SimplePie/SimplePie/Item.php | 2652 ----------------- 3rdparty/SimplePie/SimplePie/Locator.php | 337 --- 3rdparty/SimplePie/SimplePie/Misc.php | 2377 ---------------- 3rdparty/SimplePie/SimplePie/Net/IPv6.php | 257 -- 3rdparty/SimplePie/SimplePie/Parse/Date.php | 982 ------- 3rdparty/SimplePie/SimplePie/Parser.php | 399 --- 3rdparty/SimplePie/SimplePie/Rating.php | 128 - 3rdparty/SimplePie/SimplePie/Registry.php | 209 -- 3rdparty/SimplePie/SimplePie/Restriction.php | 154 - 3rdparty/SimplePie/SimplePie/Sanitize.php | 524 ---- 3rdparty/SimplePie/SimplePie/Source.php | 610 ---- .../SimplePie/SimplePie/XML/Declaration/Parser.php | 361 --- 3rdparty/SimplePie/SimplePie/gzdecode.php | 370 --- 3rdparty/SimplePie/SimplePieAutoloader.php | 85 - 3rdparty/SimplePie/autoloader.php | 86 + 3rdparty/SimplePie/library/SimplePie.php | 2977 ++++++++++++++++++++ 3rdparty/SimplePie/library/SimplePie/Author.php | 157 ++ 3rdparty/SimplePie/library/SimplePie/Cache.php | 122 + .../SimplePie/library/SimplePie/Cache/Base.php | 114 + 3rdparty/SimplePie/library/SimplePie/Cache/DB.php | 137 + .../SimplePie/library/SimplePie/Cache/File.php | 173 ++ .../SimplePie/library/SimplePie/Cache/Memcache.php | 183 ++ .../SimplePie/library/SimplePie/Cache/MySQL.php | 438 +++ 3rdparty/SimplePie/library/SimplePie/Caption.php | 210 ++ 3rdparty/SimplePie/library/SimplePie/Category.php | 157 ++ .../library/SimplePie/Content/Type/Sniffer.php | 332 +++ 3rdparty/SimplePie/library/SimplePie/Copyright.php | 130 + 3rdparty/SimplePie/library/SimplePie/Core.php | 57 + 3rdparty/SimplePie/library/SimplePie/Credit.php | 156 + .../library/SimplePie/Decode/HTML/Entities.php | 617 ++++ 3rdparty/SimplePie/library/SimplePie/Enclosure.php | 1380 +++++++++ 3rdparty/SimplePie/library/SimplePie/File.php | 292 ++ .../SimplePie/library/SimplePie/HTTP/Parser.php | 500 ++++ 3rdparty/SimplePie/library/SimplePie/IRI.php | 1234 ++++++++ 3rdparty/SimplePie/library/SimplePie/Item.php | 2964 +++++++++++++++++++ 3rdparty/SimplePie/library/SimplePie/Locator.php | 338 +++ 3rdparty/SimplePie/library/SimplePie/Misc.php | 2243 +++++++++++++++ 3rdparty/SimplePie/library/SimplePie/Net/IPv6.php | 276 ++ .../SimplePie/library/SimplePie/Parse/Date.php | 983 +++++++ 3rdparty/SimplePie/library/SimplePie/Parser.php | 403 +++ 3rdparty/SimplePie/library/SimplePie/Rating.php | 129 + 3rdparty/SimplePie/library/SimplePie/Registry.php | 209 ++ .../SimplePie/library/SimplePie/Restriction.php | 155 + 3rdparty/SimplePie/library/SimplePie/Sanitize.php | 542 ++++ 3rdparty/SimplePie/library/SimplePie/Source.php | 611 ++++ .../library/SimplePie/XML/Declaration/Parser.php | 362 +++ 3rdparty/SimplePie/library/SimplePie/gzdecode.php | 371 +++ 66 files changed, 19038 insertions(+), 17756 deletions(-) delete mode 100644 3rdparty/SimplePie/LICENSE.txt delete mode 100644 3rdparty/SimplePie/SimplePie/Author.php delete mode 100644 3rdparty/SimplePie/SimplePie/Cache.php delete mode 100644 3rdparty/SimplePie/SimplePie/Cache/Base.php delete mode 100644 3rdparty/SimplePie/SimplePie/Cache/DB.php delete mode 100644 3rdparty/SimplePie/SimplePie/Cache/File.php delete mode 100644 3rdparty/SimplePie/SimplePie/Cache/Memcache.php delete mode 100644 3rdparty/SimplePie/SimplePie/Cache/MySQL.php delete mode 100644 3rdparty/SimplePie/SimplePie/Caption.php delete mode 100644 3rdparty/SimplePie/SimplePie/Category.php delete mode 100644 3rdparty/SimplePie/SimplePie/Content/Type/Sniffer.php delete mode 100644 3rdparty/SimplePie/SimplePie/Copyright.php delete mode 100644 3rdparty/SimplePie/SimplePie/Core.php delete mode 100644 3rdparty/SimplePie/SimplePie/Credit.php delete mode 100644 3rdparty/SimplePie/SimplePie/Decode/HTML/Entities.php delete mode 100644 3rdparty/SimplePie/SimplePie/Enclosure.php delete mode 100644 3rdparty/SimplePie/SimplePie/File.php delete mode 100644 3rdparty/SimplePie/SimplePie/HTTP/Parser.php delete mode 100644 3rdparty/SimplePie/SimplePie/IRI.php delete mode 100644 3rdparty/SimplePie/SimplePie/Item.php delete mode 100644 3rdparty/SimplePie/SimplePie/Locator.php delete mode 100644 3rdparty/SimplePie/SimplePie/Misc.php delete mode 100644 3rdparty/SimplePie/SimplePie/Net/IPv6.php delete mode 100644 3rdparty/SimplePie/SimplePie/Parse/Date.php delete mode 100644 3rdparty/SimplePie/SimplePie/Parser.php delete mode 100644 3rdparty/SimplePie/SimplePie/Rating.php delete mode 100755 3rdparty/SimplePie/SimplePie/Registry.php delete mode 100644 3rdparty/SimplePie/SimplePie/Restriction.php delete mode 100644 3rdparty/SimplePie/SimplePie/Sanitize.php delete mode 100644 3rdparty/SimplePie/SimplePie/Source.php delete mode 100644 3rdparty/SimplePie/SimplePie/XML/Declaration/Parser.php delete mode 100644 3rdparty/SimplePie/SimplePie/gzdecode.php delete mode 100644 3rdparty/SimplePie/SimplePieAutoloader.php create mode 100644 3rdparty/SimplePie/autoloader.php create mode 100644 3rdparty/SimplePie/library/SimplePie.php create mode 100644 3rdparty/SimplePie/library/SimplePie/Author.php create mode 100644 3rdparty/SimplePie/library/SimplePie/Cache.php create mode 100644 3rdparty/SimplePie/library/SimplePie/Cache/Base.php create mode 100644 3rdparty/SimplePie/library/SimplePie/Cache/DB.php create mode 100644 3rdparty/SimplePie/library/SimplePie/Cache/File.php create mode 100644 3rdparty/SimplePie/library/SimplePie/Cache/Memcache.php create mode 100644 3rdparty/SimplePie/library/SimplePie/Cache/MySQL.php create mode 100644 3rdparty/SimplePie/library/SimplePie/Caption.php create mode 100644 3rdparty/SimplePie/library/SimplePie/Category.php create mode 100644 3rdparty/SimplePie/library/SimplePie/Content/Type/Sniffer.php create mode 100644 3rdparty/SimplePie/library/SimplePie/Copyright.php create mode 100644 3rdparty/SimplePie/library/SimplePie/Core.php create mode 100644 3rdparty/SimplePie/library/SimplePie/Credit.php create mode 100644 3rdparty/SimplePie/library/SimplePie/Decode/HTML/Entities.php create mode 100644 3rdparty/SimplePie/library/SimplePie/Enclosure.php create mode 100644 3rdparty/SimplePie/library/SimplePie/File.php create mode 100644 3rdparty/SimplePie/library/SimplePie/HTTP/Parser.php create mode 100644 3rdparty/SimplePie/library/SimplePie/IRI.php create mode 100644 3rdparty/SimplePie/library/SimplePie/Item.php create mode 100644 3rdparty/SimplePie/library/SimplePie/Locator.php create mode 100644 3rdparty/SimplePie/library/SimplePie/Misc.php create mode 100644 3rdparty/SimplePie/library/SimplePie/Net/IPv6.php create mode 100644 3rdparty/SimplePie/library/SimplePie/Parse/Date.php create mode 100644 3rdparty/SimplePie/library/SimplePie/Parser.php create mode 100644 3rdparty/SimplePie/library/SimplePie/Rating.php create mode 100755 3rdparty/SimplePie/library/SimplePie/Registry.php create mode 100644 3rdparty/SimplePie/library/SimplePie/Restriction.php create mode 100644 3rdparty/SimplePie/library/SimplePie/Sanitize.php create mode 100644 3rdparty/SimplePie/library/SimplePie/Source.php create mode 100644 3rdparty/SimplePie/library/SimplePie/XML/Declaration/Parser.php create mode 100644 3rdparty/SimplePie/library/SimplePie/gzdecode.php (limited to '3rdparty') diff --git a/3rdparty/SimplePie/LICENSE.txt b/3rdparty/SimplePie/LICENSE.txt deleted file mode 100644 index a822a4bd9..000000000 --- a/3rdparty/SimplePie/LICENSE.txt +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2004-2007, Ryan Parman and Geoffrey Sneddon. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are -permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of - conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, this list - of conditions and the following disclaimer in the documentation and/or other materials - provided with the distribution. - - * Neither the name of the SimplePie Team nor the names of its contributors may be used - to endorse or promote products derived from this software without specific prior - written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS -OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS -AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/3rdparty/SimplePie/SimplePie/Author.php b/3rdparty/SimplePie/SimplePie/Author.php deleted file mode 100644 index 6d1629234..000000000 --- a/3rdparty/SimplePie/SimplePie/Author.php +++ /dev/null @@ -1,156 +0,0 @@ -name = $name; - $this->link = $link; - $this->email = $email; - } - - /** - * String-ified version - * - * @return string - */ - public function __toString() - { - // There is no $this->data here - return md5(serialize($this)); - } - - /** - * Author's name - * - * @return string|null - */ - public function get_name() - { - if ($this->name !== null) - { - return $this->name; - } - else - { - return null; - } - } - - /** - * Author's link - * - * @return string|null - */ - public function get_link() - { - if ($this->link !== null) - { - return $this->link; - } - else - { - return null; - } - } - - /** - * Author's email address - * - * @return string|null - */ - public function get_email() - { - if ($this->email !== null) - { - return $this->email; - } - else - { - return null; - } - } -} - diff --git a/3rdparty/SimplePie/SimplePie/Cache.php b/3rdparty/SimplePie/SimplePie/Cache.php deleted file mode 100644 index b19e4fe5c..000000000 --- a/3rdparty/SimplePie/SimplePie/Cache.php +++ /dev/null @@ -1,121 +0,0 @@ - 'SimplePie_Cache_MySQL', - 'memcache' => 'SimplePie_Cache_Memcache', - ); - - /** - * Don't call the constructor. Please. - */ - private function __construct() { } - - /** - * Create a new SimplePie_Cache object - * - * @param string $location URL location (scheme is used to determine handler) - * @param string $filename Unique identifier for cache object - * @param string $extension 'spi' or 'spc' - * @return SimplePie_Cache_Base Type of object depends on scheme of `$location` - */ - public static function create($location, $filename, $extension) - { - $type = explode(':', $location, 2); - $type = $type[0]; - if (!empty(self::$handlers[$type])) - { - $class = self::$handlers[$type]; - return new $class($location, $filename, $extension); - } - - return new SimplePie_Cache_File($location, $filename, $extension); - } - - /** - * Register a handler - * - * @param string $type DSN type to register for - * @param string $class Name of handler class. Must implement SimplePie_Cache_Base - */ - public static function register($type, $class) - { - self::$handlers[$type] = $class; - } - - /** - * Parse a URL into an array - * - * @param string $url - * @return array - */ - public static function parse_URL($url) - { - $params = parse_url($url); - $params['extras'] = array(); - if (isset($params['query'])) - { - parse_str($params['query'], $params['extras']); - } - return $params; - } -} diff --git a/3rdparty/SimplePie/SimplePie/Cache/Base.php b/3rdparty/SimplePie/SimplePie/Cache/Base.php deleted file mode 100644 index 778132faf..000000000 --- a/3rdparty/SimplePie/SimplePie/Cache/Base.php +++ /dev/null @@ -1,113 +0,0 @@ -get_items(); - $items_by_id = array(); - - if (!empty($items)) - { - foreach ($items as $item) - { - $items_by_id[$item->get_id()] = $item; - } - - if (count($items_by_id) !== count($items)) - { - $items_by_id = array(); - foreach ($items as $item) - { - $items_by_id[$item->get_id(true)] = $item; - } - } - - if (isset($data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0])) - { - $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]; - } - elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0])) - { - $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]; - } - elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0])) - { - $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]; - } - elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['channel'][0])) - { - $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['channel'][0]; - } - else - { - $channel = null; - } - - if ($channel !== null) - { - if (isset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['entry'])) - { - unset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['entry']); - } - if (isset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['entry'])) - { - unset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['entry']); - } - if (isset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_10]['item'])) - { - unset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_10]['item']); - } - if (isset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_090]['item'])) - { - unset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_090]['item']); - } - if (isset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_20]['item'])) - { - unset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_20]['item']); - } - } - if (isset($data->data['items'])) - { - unset($data->data['items']); - } - if (isset($data->data['ordered_items'])) - { - unset($data->data['ordered_items']); - } - } - return array(serialize($data->data), $items_by_id); - } -} diff --git a/3rdparty/SimplePie/SimplePie/Cache/File.php b/3rdparty/SimplePie/SimplePie/Cache/File.php deleted file mode 100644 index ce3f33d65..000000000 --- a/3rdparty/SimplePie/SimplePie/Cache/File.php +++ /dev/null @@ -1,172 +0,0 @@ -location = $location; - $this->filename = $name; - $this->extension = $type; - $this->name = "$this->location/$this->filename.$this->extension"; - } - - /** - * Save data to the cache - * - * @param array|SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property - * @return bool Successfulness - */ - public function save($data) - { - if (file_exists($this->name) && is_writeable($this->name) || file_exists($this->location) && is_writeable($this->location)) - { - if ($data instanceof SimplePie) - { - $data = $data->data; - } - - $data = serialize($data); - return (bool) file_put_contents($this->name, $data); - } - return false; - } - - /** - * Retrieve the data saved to the cache - * - * @return array Data for SimplePie::$data - */ - public function load() - { - if (file_exists($this->name) && is_readable($this->name)) - { - return unserialize(file_get_contents($this->name)); - } - return false; - } - - /** - * Retrieve the last modified time for the cache - * - * @return int Timestamp - */ - public function mtime() - { - if (file_exists($this->name)) - { - return filemtime($this->name); - } - return false; - } - - /** - * Set the last modified time to the current time - * - * @return bool Success status - */ - public function touch() - { - if (file_exists($this->name)) - { - return touch($this->name); - } - return false; - } - - /** - * Remove the cache - * - * @return bool Success status - */ - public function unlink() - { - if (file_exists($this->name)) - { - return unlink($this->name); - } - return false; - } -} diff --git a/3rdparty/SimplePie/SimplePie/Cache/Memcache.php b/3rdparty/SimplePie/SimplePie/Cache/Memcache.php deleted file mode 100644 index 74a123550..000000000 --- a/3rdparty/SimplePie/SimplePie/Cache/Memcache.php +++ /dev/null @@ -1,179 +0,0 @@ -options = array( - 'host' => '127.0.0.1', - 'port' => 11211, - 'extras' => array( - 'timeout' => 3600, // one hour - 'prefix' => 'simplepie_', - ), - ); - $this->options = array_merge_recursive($this->options, SimplePie_Cache::parse_URL($location)); - $this->name = $this->options['extras']['prefix'] . md5("$name:$type"); - - $this->cache = new Memcache(); - $this->cache->addServer($this->options['host'], (int) $this->options['port']); - } - - /** - * Save data to the cache - * - * @param array|SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property - * @return bool Successfulness - */ - public function save($data) - { - if ($data instanceof SimplePie) - { - $data = $data->data; - } - return $this->cache->set($this->name, serialize($data), MEMCACHE_COMPRESSED, (int) $this->options['extras']['timeout']); - } - - /** - * Retrieve the data saved to the cache - * - * @return array Data for SimplePie::$data - */ - public function load() - { - $data = $this->cache->get($this->name); - - if ($data !== false) - { - return unserialize($data); - } - return false; - } - - /** - * Retrieve the last modified time for the cache - * - * @return int Timestamp - */ - public function mtime() - { - $data = $this->cache->get($this->name); - - if ($data !== false) - { - // essentially ignore the mtime because Memcache expires on it's own - return time(); - } - - return false; - } - - /** - * Set the last modified time to the current time - * - * @return bool Success status - */ - public function touch() - { - $data = $this->cache->get($this->name); - - if ($data !== false) - { - return $this->cache->set($this->name, $data, MEMCACHE_COMPRESSED, (int) $this->duration); - } - - return false; - } - - /** - * Remove the cache - * - * @return bool Success status - */ - public function unlink() - { - return $this->cache->delete($this->name, 0); - } -} diff --git a/3rdparty/SimplePie/SimplePie/Cache/MySQL.php b/3rdparty/SimplePie/SimplePie/Cache/MySQL.php deleted file mode 100644 index eaacd0464..000000000 --- a/3rdparty/SimplePie/SimplePie/Cache/MySQL.php +++ /dev/null @@ -1,437 +0,0 @@ -options = array( - 'user' => null, - 'pass' => null, - 'host' => '127.0.0.1', - 'port' => '3306', - 'path' => '', - 'extras' => array( - 'prefix' => '', - ), - ); - $this->options = array_merge_recursive($this->options, SimplePie_Cache::parse_URL($location)); - - // Path is prefixed with a "/" - $this->options['dbname'] = substr($this->options['path'], 1); - - try - { - $this->mysql = new PDO("mysql:dbname={$this->options['dbname']};host={$this->options['host']};port={$this->options['port']}", $this->options['user'], $this->options['pass'], array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8')); - } - catch (PDOException $e) - { - $this->mysql = null; - return; - } - - $this->id = $name . $type; - - if (!$query = $this->mysql->query('SHOW TABLES')) - { - $this->mysql = null; - return; - } - - $db = array(); - while ($row = $query->fetchColumn()) - { - $db[] = $row; - } - - if (!in_array($this->options['extras']['prefix'] . 'cache_data', $db)) - { - $query = $this->mysql->exec('CREATE TABLE `' . $this->options['extras']['prefix'] . 'cache_data` (`id` TEXT CHARACTER SET utf8 NOT NULL, `items` SMALLINT NOT NULL DEFAULT 0, `data` BLOB NOT NULL, `mtime` INT UNSIGNED NOT NULL, UNIQUE (`id`(125)))'); - if ($query === false) - { - $this->mysql = null; - } - } - - if (!in_array($this->options['extras']['prefix'] . 'items', $db)) - { - $query = $this->mysql->exec('CREATE TABLE `' . $this->options['extras']['prefix'] . 'items` (`feed_id` TEXT CHARACTER SET utf8 NOT NULL, `id` TEXT CHARACTER SET utf8 NOT NULL, `data` TEXT CHARACTER SET utf8 NOT NULL, `posted` INT UNSIGNED NOT NULL, INDEX `feed_id` (`feed_id`(125)))'); - if ($query === false) - { - $this->mysql = null; - } - } - } - - /** - * Save data to the cache - * - * @param array|SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property - * @return bool Successfulness - */ - public function save($data) - { - if ($this->mysql === null) - { - return false; - } - - if ($data instanceof SimplePie) - { - $data = clone $data; - - $prepared = self::prepare_simplepie_object_for_cache($data); - - $query = $this->mysql->prepare('SELECT COUNT(*) FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :feed'); - $query->bindValue(':feed', $this->id); - if ($query->execute()) - { - if ($query->fetchColumn() > 0) - { - $items = count($prepared[1]); - if ($items) - { - $sql = 'UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `items` = :items, `data` = :data, `mtime` = :time WHERE `id` = :feed'; - $query = $this->mysql->prepare($sql); - $query->bindValue(':items', $items); - } - else - { - $sql = 'UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `data` = :data, `mtime` = :time WHERE `id` = :feed'; - $query = $this->mysql->prepare($sql); - } - - $query->bindValue(':data', $prepared[0]); - $query->bindValue(':time', time()); - $query->bindValue(':feed', $this->id); - if (!$query->execute()) - { - return false; - } - } - else - { - $query = $this->mysql->prepare('INSERT INTO `' . $this->options['extras']['prefix'] . 'cache_data` (`id`, `items`, `data`, `mtime`) VALUES(:feed, :count, :data, :time)'); - $query->bindValue(':feed', $this->id); - $query->bindValue(':count', count($prepared[1])); - $query->bindValue(':data', $prepared[0]); - $query->bindValue(':time', time()); - if (!$query->execute()) - { - return false; - } - } - - $ids = array_keys($prepared[1]); - if (!empty($ids)) - { - foreach ($ids as $id) - { - $database_ids[] = $this->mysql->quote($id); - } - - $query = $this->mysql->prepare('SELECT `id` FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `id` = ' . implode(' OR `id` = ', $database_ids) . ' AND `feed_id` = :feed'); - $query->bindValue(':feed', $this->id); - - if ($query->execute()) - { - $existing_ids = array(); - while ($row = $query->fetchColumn()) - { - $existing_ids[] = $row; - } - - $new_ids = array_diff($ids, $existing_ids); - - foreach ($new_ids as $new_id) - { - if (!($date = $prepared[1][$new_id]->get_date('U'))) - { - $date = time(); - } - - $query = $this->mysql->prepare('INSERT INTO `' . $this->options['extras']['prefix'] . 'items` (`feed_id`, `id`, `data`, `posted`) VALUES(:feed, :id, :data, :date)'); - $query->bindValue(':feed', $this->id); - $query->bindValue(':id', $new_id); - $query->bindValue(':data', serialize($prepared[1][$new_id]->data)); - $query->bindValue(':date', $date); - if (!$query->execute()) - { - return false; - } - } - return true; - } - } - else - { - return true; - } - } - } - else - { - $query = $this->mysql->prepare('SELECT `id` FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :feed'); - $query->bindValue(':feed', $this->id); - if ($query->execute()) - { - if ($query->rowCount() > 0) - { - $query = $this->mysql->prepare('UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `items` = 0, `data` = :data, `mtime` = :time WHERE `id` = :feed'); - $query->bindValue(':data', serialize($data)); - $query->bindValue(':time', time()); - $query->bindValue(':feed', $this->id); - if ($this->execute()) - { - return true; - } - } - else - { - $query = $this->mysql->prepare('INSERT INTO `' . $this->options['extras']['prefix'] . 'cache_data` (`id`, `items`, `data`, `mtime`) VALUES(:id, 0, :data, :time)'); - $query->bindValue(':id', $this->id); - $query->bindValue(':data', serialize($data)); - $query->bindValue(':time', time()); - if ($query->execute()) - { - return true; - } - } - } - } - return false; - } - - /** - * Retrieve the data saved to the cache - * - * @return array Data for SimplePie::$data - */ - public function load() - { - if ($this->mysql === null) - { - return false; - } - - $query = $this->mysql->prepare('SELECT `items`, `data` FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :id'); - $query->bindValue(':id', $this->id); - if ($query->execute() && ($row = $query->fetch())) - { - $data = unserialize($row[1]); - - if (isset($this->options['items'][0])) - { - $items = (int) $this->options['items'][0]; - } - else - { - $items = (int) $row[0]; - } - - if ($items !== 0) - { - if (isset($data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0])) - { - $feed =& $data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]; - } - elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0])) - { - $feed =& $data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]; - } - elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0])) - { - $feed =& $data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]; - } - elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0])) - { - $feed =& $data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]; - } - else - { - $feed = null; - } - - if ($feed !== null) - { - $sql = 'SELECT `data` FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `feed_id` = :feed ORDER BY `posted` DESC'; - if ($items > 0) - { - $sql .= ' LIMIT ' . $items; - } - - $query = $this->mysql->prepare($sql); - $query->bindValue(':feed', $this->id); - if ($query->execute()) - { - while ($row = $query->fetchColumn()) - { - $feed['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['entry'][] = unserialize($row); - } - } - else - { - return false; - } - } - } - return $data; - } - return false; - } - - /** - * Retrieve the last modified time for the cache - * - * @return int Timestamp - */ - public function mtime() - { - if ($this->mysql === null) - { - return false; - } - - $query = $this->mysql->prepare('SELECT `mtime` FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :id'); - $query->bindValue(':id', $this->id); - if ($query->execute() && ($time = $query->fetchColumn())) - { - return $time; - } - else - { - return false; - } - } - - /** - * Set the last modified time to the current time - * - * @return bool Success status - */ - public function touch() - { - if ($this->mysql === null) - { - return false; - } - - $query = $this->mysql->prepare('UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `mtime` = :time WHERE `id` = :id'); - $query->bindValue(':time', time()); - $query->bindValue(':id', $this->id); - if ($query->execute() && $query->rowCount() > 0) - { - return true; - } - else - { - return false; - } - } - - /** - * Remove the cache - * - * @return bool Success status - */ - public function unlink() - { - if ($this->mysql === null) - { - return false; - } - - $query = $this->mysql->prepare('DELETE FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :id'); - $query->bindValue(':id', $this->id); - $query2 = $this->mysql->prepare('DELETE FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `feed_id` = :id'); - $query2->bindValue(':id', $this->id); - if ($query->execute() && $query2->execute()) - { - return true; - } - else - { - return false; - } - } -} diff --git a/3rdparty/SimplePie/SimplePie/Caption.php b/3rdparty/SimplePie/SimplePie/Caption.php deleted file mode 100644 index 80cb656bb..000000000 --- a/3rdparty/SimplePie/SimplePie/Caption.php +++ /dev/null @@ -1,209 +0,0 @@ -` captions as defined in Media RSS. - * - * Used by {@see SimplePie_Enclosure::get_caption()} and {@see SimplePie_Enclosure::get_captions()} - * - * This class can be overloaded with {@see SimplePie::set_caption_class()} - * - * @package SimplePie - */ -class SimplePie_Caption -{ - /** - * Content type - * - * @var string - * @see get_type() - */ - var $type; - - /** - * Language - * - * @var string - * @see get_language() - */ - var $lang; - - /** - * Start time - * - * @var string - * @see get_starttime() - */ - var $startTime; - - /** - * End time - * - * @var string - * @see get_endtime() - */ - var $endTime; - - /** - * Caption text - * - * @var string - * @see get_text() - */ - var $text; - - /** - * Constructor, used to input the data - * - * For documentation on all the parameters, see the corresponding - * properties and their accessors - */ - public function __construct($type = null, $lang = null, $startTime = null, $endTime = null, $text = null) - { - $this->type = $type; - $this->lang = $lang; - $this->startTime = $startTime; - $this->endTime = $endTime; - $this->text = $text; - } - - /** - * String-ified version - * - * @return string - */ - public function __toString() - { - // There is no $this->data here - return md5(serialize($this)); - } - - /** - * Get the end time - * - * @return string|null Time in the format 'hh:mm:ss.SSS' - */ - public function get_endtime() - { - if ($this->endTime !== null) - { - return $this->endTime; - } - else - { - return null; - } - } - - /** - * Get the language - * - * @link http://tools.ietf.org/html/rfc3066 - * @return string|null Language code as per RFC 3066 - */ - public function get_language() - { - if ($this->lang !== null) - { - return $this->lang; - } - else - { - return null; - } - } - - /** - * Get the start time - * - * @return string|null Time in the format 'hh:mm:ss.SSS' - */ - public function get_starttime() - { - if ($this->startTime !== null) - { - return $this->startTime; - } - else - { - return null; - } - } - - /** - * Get the text of the caption - * - * @return string|null - */ - public function get_text() - { - if ($this->text !== null) - { - return $this->text; - } - else - { - return null; - } - } - - /** - * Get the content type (not MIME type) - * - * @return string|null Either 'text' or 'html' - */ - public function get_type() - { - if ($this->type !== null) - { - return $this->type; - } - else - { - return null; - } - } -} - diff --git a/3rdparty/SimplePie/SimplePie/Category.php b/3rdparty/SimplePie/SimplePie/Category.php deleted file mode 100644 index 86de73e20..000000000 --- a/3rdparty/SimplePie/SimplePie/Category.php +++ /dev/null @@ -1,156 +0,0 @@ -term = $term; - $this->scheme = $scheme; - $this->label = $label; - } - - /** - * String-ified version - * - * @return string - */ - public function __toString() - { - // There is no $this->data here - return md5(serialize($this)); - } - - /** - * Get the category identifier - * - * @return string|null - */ - public function get_term() - { - if ($this->term !== null) - { - return $this->term; - } - else - { - return null; - } - } - - /** - * Get the categorization scheme identifier - * - * @return string|null - */ - public function get_scheme() - { - if ($this->scheme !== null) - { - return $this->scheme; - } - else - { - return null; - } - } - - /** - * Get the human readable label - * - * @return string|null - */ - public function get_label() - { - if ($this->label !== null) - { - return $this->label; - } - else - { - return $this->get_term(); - } - } -} - diff --git a/3rdparty/SimplePie/SimplePie/Content/Type/Sniffer.php b/3rdparty/SimplePie/SimplePie/Content/Type/Sniffer.php deleted file mode 100644 index ccc75c097..000000000 --- a/3rdparty/SimplePie/SimplePie/Content/Type/Sniffer.php +++ /dev/null @@ -1,331 +0,0 @@ -file = $file; - } - - /** - * Get the Content-Type of the specified file - * - * @return string Actual Content-Type - */ - public function get_type() - { - if (isset($this->file->headers['content-type'])) - { - if (!isset($this->file->headers['content-encoding']) - && ($this->file->headers['content-type'] === 'text/plain' - || $this->file->headers['content-type'] === 'text/plain; charset=ISO-8859-1' - || $this->file->headers['content-type'] === 'text/plain; charset=iso-8859-1' - || $this->file->headers['content-type'] === 'text/plain; charset=UTF-8')) - { - return $this->text_or_binary(); - } - - if (($pos = strpos($this->file->headers['content-type'], ';')) !== false) - { - $official = substr($this->file->headers['content-type'], 0, $pos); - } - else - { - $official = $this->file->headers['content-type']; - } - $official = trim(strtolower($official)); - - if ($official === 'unknown/unknown' - || $official === 'application/unknown') - { - return $this->unknown(); - } - elseif (substr($official, -4) === '+xml' - || $official === 'text/xml' - || $official === 'application/xml') - { - return $official; - } - elseif (substr($official, 0, 6) === 'image/') - { - if ($return = $this->image()) - { - return $return; - } - else - { - return $official; - } - } - elseif ($official === 'text/html') - { - return $this->feed_or_html(); - } - else - { - return $official; - } - } - else - { - return $this->unknown(); - } - } - - /** - * Sniff text or binary - * - * @return string Actual Content-Type - */ - public function text_or_binary() - { - if (substr($this->file->body, 0, 2) === "\xFE\xFF" - || substr($this->file->body, 0, 2) === "\xFF\xFE" - || substr($this->file->body, 0, 4) === "\x00\x00\xFE\xFF" - || substr($this->file->body, 0, 3) === "\xEF\xBB\xBF") - { - return 'text/plain'; - } - elseif (preg_match('/[\x00-\x08\x0E-\x1A\x1C-\x1F]/', $this->file->body)) - { - return 'application/octect-stream'; - } - else - { - return 'text/plain'; - } - } - - /** - * Sniff unknown - * - * @return string Actual Content-Type - */ - public function unknown() - { - $ws = strspn($this->file->body, "\x09\x0A\x0B\x0C\x0D\x20"); - if (strtolower(substr($this->file->body, $ws, 14)