summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2013-01-16 12:20:12 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2013-01-16 12:20:12 (GMT)
commitfed5ee8817f3d215bec5509a0d946948acd36a2d (patch)
tree07ae2913091bbdecf8d12a3fce4a91cef0f57216 /lib
parenta83404b2109079c4b44c70153d565e45857708e8 (diff)
downloadNet_LDAP3-fed5ee8817f3d215bec5509a0d946948acd36a2d.tar.gz
Unify logging; make dependency to PEAR:Log class optional
Diffstat (limited to 'lib')
-rw-r--r--lib/Net/LDAP3.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Net/LDAP3.php b/lib/Net/LDAP3.php
index 31247a6..5f11f4c 100644
--- a/lib/Net/LDAP3.php
+++ b/lib/Net/LDAP3.php
@@ -126,7 +126,7 @@ class Net_LDAP3
* method after initialization.
*/
public function __construct($config = Array()) {
- Log::trace("Net_LDAP3 being constructed");
+ if (class_exists('Log')) Log::trace("Net_LDAP3 being constructed");
if (!empty($config) && is_array($config)) {
foreach ($config as $key => $value) {
if (!isset($this->config[$key]) || empty($this->config[$key])) {
@@ -252,7 +252,7 @@ class Net_LDAP3
}
}
} else {
- Log::warning("LDAP: No schema details exist for attribute $attribute (which is strange)");
+ $this->_warning("LDAP: No schema details exist for attribute $attribute (which is strange)");
}
// The relevant parts only, please
@@ -402,7 +402,7 @@ class Net_LDAP3
*/
public function connect()
{
- Log::trace("Net_LDAP3 connecting");
+ if (class_exists('Log')) Log::trace("Net_LDAP3 connecting");
if (!function_exists('ldap_connect')) {
new PEAR_Error("No ldap support in this PHP installation", 100);
@@ -1807,7 +1807,7 @@ class Net_LDAP3
}
else {
$this->_debug("LDAP: S: " . ldap_error($this->conn));
- Log::warning("LDAP: Failed to rename $olddn to $newrdn,$new_parent");
+ $this->_warning("LDAP: Failed to rename $olddn to $newrdn,$new_parent");
return FALSE;
}
}
@@ -1822,7 +1822,7 @@ class Net_LDAP3
}
else {
$this->_debug("LDAP: S: " . ldap_error($this->conn));
- Log::warning("LDAP: Failed to replace attributes on $subject_dn: " . json_encode($attributes['replace']));
+ $this->_warning("LDAP: Failed to replace attributes on $subject_dn: " . json_encode($attributes['replace']));
return FALSE;
}
}
@@ -1837,7 +1837,7 @@ class Net_LDAP3
}
else {
$this->_debug("LDAP: S: " . ldap_error($this->conn));
- Log::warning("LDAP: Failed to delete attributes on $subject_dn: " . json_encode($attributes['del']));
+ $this->_warning("LDAP: Failed to delete attributes on $subject_dn: " . json_encode($attributes['del']));
return FALSE;
}
}
@@ -1853,7 +1853,7 @@ class Net_LDAP3
}
else {
$this->_debug("LDAP: S: " . ldap_error($this->conn));
- Log::warning("LDAP: Failed to add attributes on $subject_dn: " . json_encode($attributes['add']));
+ $this->_warning("LDAP: Failed to add attributes on $subject_dn: " . json_encode($attributes['add']));
return FALSE;
}
}