For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > May 2004 > cvs: livedocs / xml_classes5.php









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author cvs: livedocs / xml_classes5.php
Ilia Alshanetsky

2004-05-27, 6:32 pm

iliaa Thu May 27 17:34:36 2004 EDT

Modified files:
/livedocs xml_classes5.php
Log:
Inline compress() method, another 100+ method calls per page down.



http://cvs.php.net/diff.php/livedoc...1.8&r2=1.9&ty=u
Index: livedocs/xml_classes5.php
diff -u livedocs/xml_classes5.php:1.8 livedocs/xml_classes5.php:1.9
--- livedocs/xml_classes5.php:1.8 Thu May 27 17:31:19 2004
+++ livedocs/xml_classes5.php Thu May 27 17:34:36 2004
@@ -19,7 +19,7 @@
// | PHP 5 style |
// +----------------------------------------------------------------------+
//
-// $Id: xml_classes5.php,v 1.8 2004/05/27 21:31:19 iliaa Exp $
+// $Id: xml_classes5.php,v 1.9 2004/05/27 21:34:36 iliaa Exp $

class Node { /* {{{ */

@@ -141,14 +141,6 @@
//@$GLOBALS['__node_count']++;
}

- function compress()
- {
- if ((isset($this->children[0]) && !isset($this->children[1])) && $this->children[0]->tagname == '') {
- $this->content = $this->children[0]->content;
- $this->children = array();
- }
- }
-
function as_xml()
{
if (!$this->tagname) {
@@ -350,7 +342,10 @@
}
/* optimize the node; if it only contains a single cdata (anonymous) node,
* compress that node into the content */
- $this->current->compress();
+ if ((isset($this->children[0]) && !isset($this->children[1])) && $this->children[0]->tagname == '') {
+ $this->content = $this->children[0]->content;
+ $this->children = array();
+ }

$this->current = $this->current->parent;
}
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com