From: Jan Schneider Date: Mon, 15 Nov 2010 15:40:50 +0000 (+0100) Subject: Remove unsused code/variables. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e536a495c9cceabe5d78c79b8a64fb63a315dd01;p=horde.git Remove unsused code/variables. --- diff --git a/framework/Date/lib/Horde/Date.php b/framework/Date/lib/Horde/Date.php index 147ec45ea..fe06b6dae 100644 --- a/framework/Date/lib/Horde/Date.php +++ b/framework/Date/lib/Horde/Date.php @@ -194,7 +194,6 @@ class Horde_Date } if (func_num_args() > 2) { - $args = func_get_args(); // Handle args in order: year month day hour min sec tz $this->_initializeFromArgs(func_get_args()); return; diff --git a/framework/Date/lib/Horde/Date/Repeater/DayPortion.php b/framework/Date/lib/Horde/Date/Repeater/DayPortion.php index f9bdd655b..19b490c87 100644 --- a/framework/Date/lib/Horde/Date/Repeater/DayPortion.php +++ b/framework/Date/lib/Horde/Date/Repeater/DayPortion.php @@ -51,8 +51,6 @@ class Horde_Date_Repeater_DayPortion extends Horde_Date_Repeater { parent::next($pointer); - $fullDay = 60 * 60 * 24; - if (!$this->currentSpan) { $nowSeconds = $this->now->hour * 3600 + $this->now->min * 60 + $this->now->sec; if ($nowSeconds < $this->range[0]) { diff --git a/framework/Date/lib/Horde/Date/Repeater/Time.php b/framework/Date/lib/Horde/Date/Repeater/Time.php index a90cd1f7f..21e37f56c 100644 --- a/framework/Date/lib/Horde/Date/Repeater/Time.php +++ b/framework/Date/lib/Horde/Date/Repeater/Time.php @@ -5,7 +5,7 @@ class Horde_Date_Repeater_Time extends Horde_Date_Repeater public $type; public $ambiguous; - public function __construct($time, $options = array()) + public function __construct($time) { $t = str_replace(':', '', $time); diff --git a/framework/Ldap/lib/Horde/Ldap.php b/framework/Ldap/lib/Horde/Ldap.php index ec2f5b042..bfbde3cc9 100644 --- a/framework/Ldap/lib/Horde/Ldap.php +++ b/framework/Ldap/lib/Horde/Ldap.php @@ -699,10 +699,7 @@ class Horde_Ldap } catch (Exception $e) { /* We have a failure. What kind? We may be able to * reconnect and try again. */ - $error_code = $e->getCode(); - $error_name = $this->errorName($error_code); - - if ($this->errorName($error_code) != 'LDAP_OPERATIONS_ERROR' || + if ($this->errorName($e->getCode()) != 'LDAP_OPERATIONS_ERROR' || !$this->_config['auto_reconnect']) { /* Errors other than the above catched are just passed * back to the user so he may react upon them. */ @@ -1005,14 +1002,7 @@ class Horde_Ldap /* Make dn relative to parent. */ $base = Horde_Ldap_Util::explodeDN($dn, array('casefold' => 'none', 'reverse' => false, 'onlyvalues' => false)); - $entry_rdn = array_shift($base); - if (is_array($entry_rdn)) { - /* Maybe the dn consist of a multivalued RDN. We must - * build the dn in this case because the $entry_rdn is an - * array. */ - $filter_dn = Horde_Ldap_Util::canonicalDN($entry_rdn); - } $base = Horde_Ldap_Util::canonicalDN($base); $result = @ldap_list($this->_link, $base, $entry_rdn, array(), 1, 1); diff --git a/framework/Ldap/lib/Horde/Ldap/Entry.php b/framework/Ldap/lib/Horde/Ldap/Entry.php index 75dda34be..f2dcd5d55 100644 --- a/framework/Ldap/lib/Horde/Ldap/Entry.php +++ b/framework/Ldap/lib/Horde/Ldap/Entry.php @@ -350,7 +350,7 @@ class Horde_Ldap_Entry public function getValues() { $attrs = array(); - foreach ($this->_attributes as $attr => $value) { + foreach (array_keys($this->_attributes) as $attr) { $attrs[$attr] = $this->getValue($attr); } return $attrs; @@ -645,7 +645,7 @@ class Horde_Ldap_Entry /* New entry. */ if ($this->_new) { - $msg = $ldap->add($this); + $ldap->add($this); $this->_new = false; $this->_changes['add'] = array(); $this->_changes['delete'] = array(); diff --git a/framework/Ldap/lib/Horde/Ldap/Filter.php b/framework/Ldap/lib/Horde/Ldap/Filter.php index f3666d6e3..8b2ff668e 100644 --- a/framework/Ldap/lib/Horde/Ldap/Filter.php +++ b/framework/Ldap/lib/Horde/Ldap/Filter.php @@ -390,7 +390,6 @@ class Horde_Ldap_Filter // operator. $subfilters_o = array(); foreach ($subfilters as $s_s) { - $o = self::parse($s_s); array_push($subfilters_o, self::parse($s_s)); } if (count($subfilters_o) == 1) { diff --git a/framework/Ldap/lib/Horde/Ldap/Ldif.php b/framework/Ldap/lib/Horde/Ldap/Ldif.php index 3c1740dee..0321f634e 100644 --- a/framework/Ldap/lib/Horde/Ldap/Ldif.php +++ b/framework/Ldap/lib/Horde/Ldap/Ldif.php @@ -307,7 +307,7 @@ class Horde_Ldap_Ldif } elseif ($entry->willBeMoved()) { $this->_writeLine('changetype: modrdn'); $olddn = Horde_Ldap_Util::explodeDN($entry->currentDN(), array('casefold' => 'none')); - $oldrdn = array_shift($olddn); + array_shift($olddn); $oldparent = implode(',', $olddn); $newdn = Horde_Ldap_Util::explodeDN($entry->dn(), array('casefold' => 'none')); $rdn = array_shift($newdn); @@ -449,7 +449,7 @@ class Horde_Ldap_Ldif } // Free variables. - foreach (get_object_vars($this) as $name => $value) { + foreach (array_keys(get_object_vars($this)) as $name) { unset($this->$name); } } diff --git a/framework/Ldap/lib/Horde/Ldap/Search.php b/framework/Ldap/lib/Horde/Ldap/Search.php index ced3c6a0e..9e9a727ee 100644 --- a/framework/Ldap/lib/Horde/Ldap/Search.php +++ b/framework/Ldap/lib/Horde/Ldap/Search.php @@ -321,7 +321,7 @@ class Horde_Ldap_Search implements Iterator { $return = array(); $sorted = $this->sortedAsArray($attrs, $order); - foreach ($sorted as $key => $row) { + foreach ($sorted as $row) { $entry = $this->_ldap->getEntry($row['dn'], $this->searchedAttributes()); array_push($return, $entry); } diff --git a/framework/Ldap/lib/Horde/Ldap/Util.php b/framework/Ldap/lib/Horde/Ldap/Util.php index 4e172063e..65da557c3 100644 --- a/framework/Ldap/lib/Horde/Ldap/Util.php +++ b/framework/Ldap/lib/Horde/Ldap/Util.php @@ -114,7 +114,6 @@ class Horde_Ldap_Util if ($options['onlyvalues']) { preg_match('/(.+?)(?