*/
function __destruct()
{
- if (!empty($this->data['items']))
+ if ((version_compare(PHP_VERSION, '5.3', '<') || !gc_enabled()) && !ini_get('zend.ze1_compatibility_mode'))
{
- foreach ($this->data['items'] as $item)
+ if (!empty($this->data['items']))
{
- $item->__destruct();
+ foreach ($this->data['items'] as $item)
+ {
+ $item->__destruct();
+ }
+ unset($item, $this->data['items']);
}
- unset($this->data['items']);
- }
- if (!empty($this->data['ordered_items']))
- {
- foreach ($this->data['ordered_items'] as $item)
+ if (!empty($this->data['ordered_items']))
{
- $item->__destruct();
+ foreach ($this->data['ordered_items'] as $item)
+ {
+ $item->__destruct();
+ }
+ unset($item, $this->data['ordered_items']);
}
- unset($this->data['ordered_items']);
}
}
$headers = $file->headers;
$data = $file->body;
- $sniffer = new $this->content_type_sniffer_class($file);
+ $sniffer =& new $this->content_type_sniffer_class($file);
$sniffed = $sniffer->get_type();
}
else
if ($file->success && ($file->status_code == 200 || ($file->status_code > 206 && $file->status_code < 300)) && strlen($file->body) > 0)
{
- $sniffer = new $this->content_type_sniffer_class($file);
+ $sniffer =& new $this->content_type_sniffer_class($file);
if (substr($sniffer->get_type(), 0, 6) === 'image/')
{
if ($cache->save(array('headers' => $file->headers, 'body' => $file->body)))
*/
function __destruct()
{
- unset($this->feed);
+ if ((version_compare(PHP_VERSION, '5.3', '<') || !gc_enabled()) && !ini_get('zend.ze1_compatibility_mode'))
+ {
+ unset($this->feed);
+ }
}
function get_item_tags($namespace, $tag)
return md5(serialize($this->data));
}
- /**
- * Remove items that link back to this before destroying this object
- */
- function __destruct()
- {
- unset($this->item);
- }
-
function get_source_tags($namespace, $tag)
{
if (isset($this->data['child'][$namespace][$tag]))
{
case 'gzip':
case 'x-gzip':
- $decoder = new SimplePie_gzdecode($this->body);
+ $decoder =& new SimplePie_gzdecode($this->body);
if (!$decoder->parse())
{
$this->error = 'Unable to decode HTTP "gzip" stream';
function parse_url($url)
{
- static $cache = array();
- if (isset($cache[$url]))
- {
- return $cache[$url];
- }
- elseif (preg_match('/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/', $url, $match))
+ preg_match('/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/', $url, $match);
+ for ($i = count($match); $i <= 9; $i++)
{
- for ($i = count($match); $i <= 9; $i++)
- {
- $match[$i] = '';
- }
- return $cache[$url] = array('scheme' => $match[2], 'authority' => $match[4], 'path' => $match[5], 'query' => $match[7], 'fragment' => $match[9]);
- }
- else
- {
- return $cache[$url] = array('scheme' => '', 'authority' => '', 'path' => '', 'query' => '', 'fragment' => '');
+ $match[$i] = '';
}
+ return array('scheme' => $match[2], 'authority' => $match[4], 'path' => $match[5], 'query' => $match[7], 'fragment' => $match[9]);
}
function compress_parse_url($scheme = '', $authority = '', $path = '', $query = '', $fragment = '')
*/
function entities_decode($data)
{
- $decoder = new SimplePie_Decode_HTML_Entities($data);
+ $decoder =& new SimplePie_Decode_HTML_Entities($data);
return $decoder->parse();
}
*/
function codepoint_to_utf8($codepoint)
{
- static $cache = array();
$codepoint = (int) $codepoint;
- if (isset($cache[$codepoint]))
- {
- return $cache[$codepoint];
- }
- elseif ($codepoint < 0)
+ if ($codepoint < 0)
{
- return $cache[$codepoint] = false;
+ return false;
}
else if ($codepoint <= 0x7f)
{
- return $cache[$codepoint] = chr($codepoint);
+ return chr($codepoint);
}
else if ($codepoint <= 0x7ff)
{
- return $cache[$codepoint] = chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f));
+ return chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f));
}
else if ($codepoint <= 0xffff)
{
- return $cache[$codepoint] = chr(0xe0 | ($codepoint >> 12)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
+ return chr(0xe0 | ($codepoint >> 12)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
}
else if ($codepoint <= 0x10ffff)
{
- return $cache[$codepoint] = chr(0xf0 | ($codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3f)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
+ return chr(0xf0 | ($codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3f)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
}
else
{
// U+FFFD REPLACEMENT CHARACTER
- return $cache[$codepoint] = "\xEF\xBF\xBD";
+ return "\xEF\xBF\xBD";
}
}
{
if ($pos = strpos($data, "\x00\x00\x00\x3F\x00\x00\x00\x3E"))
{
- $parser = new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32BE', 'UTF-8'));
+ $parser =& new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32BE', 'UTF-8'));
if ($parser->parse())
{
$encoding[] = $parser->encoding;
{
if ($pos = strpos($data, "\x3F\x00\x00\x00\x3E\x00\x00\x00"))
{
- $parser = new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32LE', 'UTF-8'));
+ $parser =& new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32LE', 'UTF-8'));
if ($parser->parse())
{
$encoding[] = $parser->encoding;
{
if ($pos = strpos($data, "\x00\x3F\x00\x3E"))
{
- $parser = new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16BE', 'UTF-8'));
+ $parser =& new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16BE', 'UTF-8'));
if ($parser->parse())
{
$encoding[] = $parser->encoding;
{
if ($pos = strpos($data, "\x3F\x00\x3E\x00"))
{
- $parser = new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16LE', 'UTF-8'));
+ $parser =& new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16LE', 'UTF-8'));
if ($parser->parse())
{
$encoding[] = $parser->encoding;
{
if ($pos = strpos($data, "\x3F\x3E"))
{
- $parser = new SimplePie_XML_Declaration_Parser(substr($data, 5, $pos - 5));
+ $parser =& new SimplePie_XML_Declaration_Parser(substr($data, 5, $pos - 5));
if ($parser->parse())
{
$encoding[] = $parser->encoding;
static $cache;
if (!isset($cache[get_class($this)]))
{
- if (extension_loaded('Reflection'))
- {
- $class = new ReflectionClass(get_class($this));
- $methods = $class->getMethods();
- $all_methods = array();
- foreach ($methods as $method)
- {
- $all_methods[] = $method->getName();
- }
- }
- else
- {
- $all_methods = get_class_methods($this);
- }
+ $all_methods = get_class_methods($this);
foreach ($all_methods as $method)
{
static $object;
if (!$object)
{
- $object = new SimplePie_Parse_Date;
+ $object =& new SimplePie_Parse_Date;
}
return $object;
}
if ($this->file->method & SIMPLEPIE_FILE_SOURCE_REMOTE)
{
- $sniffer = new $this->content_type_sniffer_class($this->file);
+ $sniffer =& new $this->content_type_sniffer_class($this->file);
if ($sniffer->get_type() !== 'text/html')
{
return null;
{
if ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE)
{
- $sniffer = new $this->content_type_sniffer_class($file);
+ $sniffer =& new $this->content_type_sniffer_class($file);
$sniffed = $sniffer->get_type();
if (in_array($sniffed, array('application/rss+xml', 'application/rdf+xml', 'text/rdf', 'application/atom+xml', 'text/xml', 'application/xml')))
{
if (substr($data, 0, 5) === '<?xml' && strspn(substr($data, 5, 1), "\x09\x0A\x0D\x20") && ($pos = strpos($data, '?>')) !== false)
{
- $declaration = new SimplePie_XML_Declaration_Parser(substr($data, 5, $pos - 5));
+ $declaration =& new SimplePie_XML_Declaration_Parser(substr($data, 5, $pos - 5));
if ($declaration->parse())
{
$data = substr($data, $pos + 2);
}
}
-?>
\ No newline at end of file
+?>