Improvements to debug_log

This commit is contained in:
Deon George
2009-08-19 13:39:37 +10:00
parent 0eaf3bb67b
commit 5669c92371
26 changed files with 1478 additions and 531 deletions

View File

@@ -37,6 +37,9 @@ class TreeItem {
private $template = null;
public function __construct($server_id,$dn) {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',33,0,__FILE__,__LINE__,__METHOD__,$fargs);
$this->server_id = $server_id;
$this->dn = $dn;
}
@@ -47,6 +50,9 @@ class TreeItem {
* @return DN The DN of this item.
*/
public function getDN() {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',33,1,__FILE__,__LINE__,__METHOD__,$fargs,$this->dn);
return $this->dn;
}
@@ -56,6 +62,9 @@ class TreeItem {
* @return RDN The RDN of this items DN.
*/
public function getRDN() {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',33,0,__FILE__,__LINE__,__METHOD__,$fargs);
return get_rdn($this->getDn(),0,true);
}
@@ -63,6 +72,9 @@ class TreeItem {
* Set this item as a LDAP base DN item.
*/
public function setBase() {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',33,1,__FILE__,__LINE__,__METHOD__,$fargs);
$this->base_entry = true;
}
@@ -70,18 +82,30 @@ class TreeItem {
* Return if this item is a base DN item.
*/
public function isBaseDN() {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',33,1,__FILE__,__LINE__,__METHOD__,$fargs,$this->base_entry);
return $this->base_entry;
}
public function setObjectClasses($oc) {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',33,1,__FILE__,__LINE__,__METHOD__,$fargs);
$this->objectclasses = $oc;
}
public function getObjectClasses() {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',33,1,__FILE__,__LINE__,__METHOD__,$fargs,$this->objectclasses);
return $this->objectclasses;
}
public function isInLDAP() {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',33,0,__FILE__,__LINE__,__METHOD__,$fargs);
return count($this->objectclasses) ? true : false;
}
@@ -90,6 +114,9 @@ class TreeItem {
* or an array of the dn of the children
*/
public function getChildren() {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',33,1,__FILE__,__LINE__,__METHOD__,$fargs,$this->children);
return $this->children;
}
@@ -99,17 +126,14 @@ class TreeItem {
* @param DN The DN to add.
*/
public function addChild($dn) {
if (DEBUG_ENABLED)
debug_log('Entered with (%s)',1,__FILE__,__LINE__,__METHOD__,$dn);
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',33,0,__FILE__,__LINE__,__METHOD__,$fargs);
if (in_array($dn,$this->children))
return;
array_push($this->children,$dn);
usort($this->children,'pla_compare_dns');
if (DEBUG_ENABLED)
debug_log('Entered with (%s), Leaving ()',1,__FILE__,__LINE__,__METHOD__,$dn);
}
/**
@@ -118,8 +142,8 @@ class TreeItem {
* @param DN The DN to add.
*/
public function delChild($dn) {
if (DEBUG_ENABLED)
debug_log('Entered with (%s)',1,__FILE__,__LINE__,__METHOD__,$dn);
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',33,0,__FILE__,__LINE__,__METHOD__,$fargs);
if ($this->children) {
# If the parent hasnt been opened in the tree, then there wont be any children.
@@ -136,6 +160,9 @@ class TreeItem {
* @param DN The DN to rename to.
*/
public function rename($dn) {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',33,0,__FILE__,__LINE__,__METHOD__,$fargs);
$this->dn = $dn;
}
@@ -143,6 +170,9 @@ class TreeItem {
* Return if this item has been opened.
*/
public function isOpened() {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',33,1,__FILE__,__LINE__,__METHOD__,$fargs,$this->open);
return $this->open;
}
@@ -150,6 +180,9 @@ class TreeItem {
* Mark this node as closed.
*/
public function close() {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',33,0,__FILE__,__LINE__,__METHOD__,$fargs);
$this->open = false;
}
@@ -157,6 +190,9 @@ class TreeItem {
* Opens the node ; the children of the node must have been defined
*/
public function open() {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',33,0,__FILE__,__LINE__,__METHOD__,$fargs);
$this->open = true;
}
@@ -164,6 +200,9 @@ class TreeItem {
* Mark this node as a leaf.
*/
public function setLeaf() {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',33,1,__FILE__,__LINE__,__METHOD__,$fargs);
$this->leaf = true;
}
@@ -171,6 +210,9 @@ class TreeItem {
* Return if this node is a leaf.
*/
public function isLeaf() {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',33,1,__FILE__,__LINE__,__METHOD__,$fargs,$this->leaf);
return $this->leaf;
}
@@ -179,6 +221,9 @@ class TreeItem {
* If the icon hasnt been set, it will call get_icon()
*/
public function getIcon() {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',33,1,__FILE__,__LINE__,__METHOD__,$fargs,$this->icon);
if (! $this->icon)
$this->icon = get_icon($this->server_id,$this->dn,$this->objectclasses);
@@ -189,6 +234,9 @@ class TreeItem {
* Mark this node as a size limited (it wont have all its children).
*/
public function setSizeLimited() {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',33,1,__FILE__,__LINE__,__METHOD__,$fargs);
$this->size_limited = true;
}
@@ -196,6 +244,9 @@ class TreeItem {
* Clear the size limited flag.
*/
public function unsetSizeLimited() {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',33,0,__FILE__,__LINE__,__METHOD__,$fargs);
$this->size_limited = false;
}
@@ -203,14 +254,23 @@ class TreeItem {
* Return if this node has hit an LDAP size limit (and thus doesnt have all its children).
*/
public function isSizeLimited() {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',33,0,__FILE__,__LINE__,__METHOD__,$fargs);
return $this->size_limited;
}
public function setTemplate($template) {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',33,1,__FILE__,__LINE__,__METHOD__,$fargs);
$this->template = $template;
}
public function getTemplate() {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',33,0,__FILE__,__LINE__,__METHOD__,$fargs);
return $this->template;
}
}