cvs: pear /DB_NestedSet NestedSet.php /DB_NestedSet/NestedSet Node.php
| From: | Daniel Khan | Date: | Tue, 25 Oct 2005 23:39:53 +0000 |
| Subject: | cvs: pear /DB_NestedSet NestedSet.php /DB_NestedSet/NestedSet Node.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-35864@lists.php.net to get a copy of this message | ||
datenpunk Tue Oct 25 19:39:53 2005 EDT
Added files:
/pear/DB_NestedSet/NestedSet Node.php
Modified files:
/pear/DB_NestedSet NestedSet.php
Log:
Fulfilled Request #4945 Move DB_NestedSet_Node into own file
http://cvs.php.net/diff.php/pear/DB_NestedSet/NestedSet.php?r1=1.88&r2=1.89&ty=u
Index: pear/DB_NestedSet/NestedSet.php
diff -u pear/DB_NestedSet/NestedSet.php:1.88 pear/DB_NestedSet/NestedSet.php:1.89
--- pear/DB_NestedSet/NestedSet.php:1.88 Tue Oct 25 19:16:19 2005
+++ pear/DB_NestedSet/NestedSet.php Tue Oct 25 19:39:53 2005
@@ -15,7 +15,7 @@
// | Authors: Daniel Khan <dk@webcluster.at> |
// | Jason Rust <jason@rustyparts.com> |
// +----------------------------------------------------------------------+
-// $Id: NestedSet.php,v 1.88 2005/10/25 23:16:19 datenpunk Exp $
+// $Id: NestedSet.php,v 1.89 2005/10/25 23:39:53 datenpunk Exp $
// CREDITS:
// --------
// - Thanks to Kristian Koehntopp for publishing an explanation of the Nested Set
@@ -50,7 +50,7 @@
*
* @author Daniel Khan <dk@webcluster.at>
* @package DB_NestedSet
-* @version $Revision: 1.88 $
+* @version $Revision: 1.89 $
* @access public
*/
// }}}
@@ -343,6 +343,8 @@
}
include_once($driverpath);
}
+ // Todo: Only load the node class when needed
+ include_once(dirname(__FILE__) . '/NestedSet/Node.php');
$c = & new $classname($dsn, $params);
return $c;
}
@@ -2095,7 +2097,7 @@
'majorversion' => $this->_majorversion,
'minorversion' => $this->_minorversion,
'version' => sprintf('%s.%s', $this->_majorversion,
$this->_minorversion),
- 'revision' => str_replace('$', '', '$Revision: 1.88
$')
+ 'revision' => str_replace('$', '', '$Revision: 1.89
$')
);
}
// }}}
@@ -2474,41 +2476,5 @@
}
// }}}
}
-// {{{ DB_NestedSet_Node:: class
-/**
-* Generic class for node objects
-*
-* @autor Daniel Khan <dk@webcluster.at>;
-* @version $Revision: 1.88 $
-* @package DB_NestedSet
-* @access private
-*/
-
-class DB_NestedSet_Node {
- // {{{ constructor
- /**
- * Constructor
- */
- function DB_NestedSet_Node($data) {
- if (!is_array($data) || count($data) == 0) {
- return new PEAR_ERROR($data, NESE_ERROR_PARAM_MISSING);
- }
- $this->setAttr($data);
- return true;
- }
- // }}}
- // {{{ setAttr()
- function setAttr($data) {
- if (!is_array($data) || count($data) == 0) {
- return false;
- }
-
- foreach ($data as $key => $val) {
- $this->$key = $val;
- }
- }
- // }}}
-}
-// }}}
?>
\ No newline at end of file
http://cvs.php.net/co.php/pear/DB_NestedSet/NestedSet/Node.php?r=1.1&p=1
Index: pear/DB_NestedSet/NestedSet/Node.php
+++ pear/DB_NestedSet/NestedSet/Node.php
<?php
// +----------------------------------------------------------------------+
// | PEAR :: DB_NestedSet_Node |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt.
|
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Daniel Khan <dk@webcluster.at> |
// +----------------------------------------------------------------------+
// $Id: Node.php,v 1.1 2005/10/25 23:39:53 datenpunk Exp $
// {{{ DB_NestedSet_Node:: class
/**
* Generic class for node objects
*
* @autor Daniel Khan <dk@webcluster.at>;
* @version $Revision: 1.1 $
* @package DB_NestedSet
* @access private
*/
class DB_NestedSet_Node {
// {{{ constructor
/**
* Constructor
*/
function DB_NestedSet_Node($data) {
if (!is_array($data) || count($data) == 0) {
return new PEAR_ERROR($data, NESE_ERROR_PARAM_MISSING);
}
$this->setAttr($data);
return true;
}
// }}}
// {{{ setAttr()
function setAttr($data) {
if (!is_array($data) || count($data) == 0) {
return false;
}
foreach ($data as $key => $val) {
$this->$key = $val;
}
}
// }}}
}
// }}}
?>