Permalink
Browse files

Removed old deprecated methods

2.0b1 version ready


git-svn-id: http://svn.php.net/repository/pear/packages/XML_Tree/trunk@140132 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent ba61d2c commit 343ba6a4e288da58c7dbed6b12986f3db0df1acf @tvvcox tvvcox committed Sep 11, 2003
Showing with 25 additions and 108 deletions.
  1. +5 −40 Tree.php
  2. +0 −60 Tree/Node.php
  3. +18 −6 package.xml
  4. +2 −2 tests/test.php
View
@@ -15,7 +15,7 @@
// +----------------------------------------------------------------------+
// | Authors: Bernd Römer <berndr@bonn.edu> |
// | Sebastian Bergmann <sb@sebastian-bergmann.de> |
-// | Tomas V.V.Cox <cox@idecnet.com> (tree mapping from xml file)|
+// | Tomas V.V.Cox <cox@idecnet.com> |
// | Michele Manzato <michele.manzato@verona.miz.it> |
// +----------------------------------------------------------------------+
//
@@ -125,13 +125,6 @@ function &addRoot($name, $content = '', $attributes = array(), $lineno = null)
}
/**
- * @deprecated
- */
- function &add_root($name, $content = '', $attributes = array()) {
- return $this->addRoot($name, $content, $attributes);
- }
-
- /**
* Inserts a child/tree (child) into tree ($path,$pos) and maintains
* namespace integrity
*
@@ -171,13 +164,6 @@ function &insertChild($path, $pos, $child, $content = '', $attributes = array())
return $x;
}
- /**
- * @deprecated
- */
- function &insert_child($path,$pos,$child, $content = '', $attributes = array()) {
- return $this->insertChild($path, $child, $content, $attributes);
- }
-
/*
* Removes a child node from tree and maintains namespace integrity
*
@@ -218,13 +204,6 @@ function &removeChild($path, $pos)
return $x;
}
- /**
- * @deprecated
- */
- function &remove_child($path, $pos) {
- return $this->removeChild($path, $pos);
- }
-
/*
* Maps a XML file to a XML_Tree
*
@@ -416,13 +395,6 @@ function &getName($name) {
}
/**
- * @deprecated
- */
- function &get_name($name) {
- return $this->getName($name);
- }
-
- /**
* Register a namespace.
*
* @param string $name namespace
@@ -435,19 +407,12 @@ function registerName($name, $path) {
}
/**
- * @deprecated
- */
- function register_name($name, $path) {
- return $this->registerName($name, $path);
- }
-
- /**
* Get a reference to a node. Node is searched by its 'path'.
*
- * @param mixed path Path to node. Can be either a string (slash-separated
- * children names) or an array (sequence of children names) both
- * of them starting from node. Note that the first name in sequence
- * must be the name of the document root.
+ * @param mixed path Path to node. Can be either a string (slash-separated
+ * children names) or an array (sequence of children names) both
+ * of them starting from node. Note that the first name in sequence
+ * must be the name of the document root.
* @return object Reference to the XML_Tree_Node found, or PEAR_Error if
* the path does not exist. If more than one element matches
* then only the first match is returned.
View
@@ -105,13 +105,6 @@ function &addChild($child, $content = '', $attributes = array(), $lineno = null)
}
/**
- * @deprecated
- */
- function &add_child($child, $content = '', $attributes = array()) {
- return $this->addChild($child, $content, $attributes);
- }
-
- /**
* Get a copy of this node by clone this node and all of its children,
* recursively.
*
@@ -200,13 +193,6 @@ function &insertChild($path,$pos,&$child, $content = '', $attributes = array())
}
/**
- * @deprecated
- */
- function &insert_child($path,$pos,&$child, $content = '', $attributes = array()) {
- return $this->insertChild($path,$pos,$child, $content, $attributes);
- }
-
- /**
* Removes child at a given position
*
* @param integer pos position of child to remove in children-list.
@@ -227,13 +213,6 @@ function &removeChild($pos)
}
/**
- * @deprecated
- */
- function &remove_child($pos) {
- return $this->removeChild($pos);
- }
-
- /**
* Returns text representation of this node.
*
* @return string text (xml) representation of this node. Each tag is
@@ -297,13 +276,6 @@ function getAttribute($name)
}
/**
- * @deprecated
- */
- function get_attribute($name) {
- return $this->getAttribute($name);
- }
-
- /**
* Sets an attribute for this node.
*
* @param string name Name of attribute to set
@@ -317,14 +289,6 @@ function setAttribute($name, $value = '')
}
/**
- * @deprecated
- */
- function set_attribute($name, $value = '')
- {
- return $this->setAttribute($name, $value);
- }
-
- /**
* Unsets an attribute of this node.
*
* @param string $name Name of attribute to unset
@@ -339,14 +303,6 @@ function unsetAttribute($name)
}
/**
- * @deprecated
- */
- function unset_attribute($name)
- {
- return $this->unsetAttribute($name);
- }
-
- /**
* Sets the content for this node.
*
* @param string content Node content to assign
@@ -359,14 +315,6 @@ function setContent(&$content)
}
/**
- * @deprecated
- */
- function set_content(&$content)
- {
- return $this->setContent($content);
- }
-
- /**
* Gets an element by its 'path'.
*
* @param array path path to element: sequence of indexes to the
@@ -444,14 +392,6 @@ function &getNodeAt($path)
}
/**
- * @deprecated
- */
- function &get_element($path)
- {
- return $this->getElement($path);
- }
-
- /**
* Escape XML entities.
*
* @param string xml Text string to escape.
View
@@ -5,7 +5,7 @@
<name>XML_Tree</name>
<summary>Represent XML data in a tree structure</summary>
<description>
- Allows for the building of XML data structures using a tree
+ Allows for the building of XML data structures using a tree
representation, without the need for an extension like DOMXML.
</description>
<maintainers>
@@ -23,24 +23,36 @@
</maintainer>
</maintainers>
<release>
- <version>1.2</version>
- <date>2003-07-10</date>
+ <version>2.0b1</version>
+ <date>2003-09-11</date>
<license>PHP</license>
- <state>stable</state>
+ <state>beta</state>
<notes>
+Contributed by Michele Manzato &lt;Michele.Manzato@verona.miz.it&gt;:
+
- Fixed insertChild() and removeChild()
- Added getNodeAt() (gets a node by its path)
- Added decodeXmlEntities()
- Improved PHPDoc
-Contributed by Michele Manzato &lt;Michele.Manzato@verona.miz.it&gt;
+Others:
+
+- Added new "lineno" to the XML_Tree_Node object, containing the
+ line number of the input where a node is declared. (cox)
+- Removed deprecated methods in the form xxx_yyyy() like
+ add_child(), get_element(), etc. Only the PEAR CS compilant
+ ones should be used now addChild(), getElement(), etc. (cox)
+
</notes>
<filelist>
<dir name="/" baseinstalldir="XML">
<file role="php" name="Tree.php"/>
- <dir name="Tree">
+ <dir name="Tree">
<file role="php" name="Node.php"/>
</dir>
+ <dir name="tests">
+ <file role="test" name="test.php"/>
+ </dir>
</dir>
</filelist>
</release>
View
@@ -1,9 +1,9 @@
<?php
error_reporting(E_ALL);
require 'XML/Tree.php';
-
+ob_implicit_flush(true);
// Build a xml file
- /* <-- (un)comment this line for the 2º example
+// /* <-- (un)comment this line for the 2º example
$tree = new XML_Tree;
$root = $tree->addRoot('MyFriends');
$foo = $root->addChild('name', 'Foo');

0 comments on commit 343ba6a

Please sign in to comment.