cvs: pear /Net_LDAP2/LDAP2 LDIF.php
| From: | Benedikt Hallinger | Date: | Thu, 30 Apr 2009 07:58:36 +0000 |
| Subject: | cvs: pear /Net_LDAP2/LDAP2 LDIF.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-56010@lists.php.net to get a copy of this message | ||
beni Thu Apr 30 07:58:36 2009 UTC
Modified files:
/pear/Net_LDAP2/LDAP2 LDIF.php
Log:
* phpcs errors fixed
http://cvs.php.net/viewvc.cgi/pear/Net_LDAP2/LDAP2/LDIF.php?r1=1.7&r2=1.8&diff_format=u Index: pear/Net_LDAP2/LDAP2/LDIF.php diff -u pear/Net_LDAP2/LDAP2/LDIF.php:1.7 pear/Net_LDAP2/LDAP2/LDIF.php:1.8 --- pear/Net_LDAP2/LDAP2/LDIF.php:1.7 Thu Apr 30 07:36:21 2009 +++ pear/Net_LDAP2/LDAP2/LDIF.php Thu Apr 30 07:58:35 2009 @@ -10,7 +10,7 @@ * @author Benedikt Hallinger <beni@php.net> * @copyright 2009 Benedikt Hallinger * @license http://www.gnu.org/copyleft/lesser.html LGPL -* @version CVS: $Id: LDIF.php,v 1.7 2009/04/30 07:36:21 beni Exp $ +* @version CVS: $Id: LDIF.php,v 1.8 2009/04/30 07:58:35 beni Exp $ * @link http://pear.php.net/package/Net_LDAP2/ */ @@ -224,7 +224,7 @@ // todo: maybe implement further checks on possible values foreach ($options as $option => $value) { if (!array_key_exists($option, $this->_options)) { - $this->_dropError('Net_LDAP2_LDIF error: option '.$option.' not known!'); + $this->dropError('Net_LDAP2_LDIF error: option '.$option.' not known!'); return; } else { $this->_options[$option] = strtolower($value); @@ -236,7 +236,7 @@ // setup file mode if (!preg_match('/^[rwa]\+?$/', $mode)) { - $this->_dropError('Net_LDAP2_LDIF error: file mode '.$mode.' not supported!'); + $this->dropError('Net_LDAP2_LDIF error: file mode '.$mode.' not supported!'); } else { $this->_mode = $mode; @@ -248,11 +248,11 @@ $imode = substr($this->_mode, 0, 1); if ($imode == 'r') { if (!file_exists($file)) { - $this->_dropError('Unable to open '.$file.' for read: file not found'); + $this->dropError('Unable to open '.$file.' for read: file not found'); $this->_mode = false; } if (!is_readable($file)) { - $this->_dropError('Unable to open '.$file.' for read: permission denied'); + $this->dropError('Unable to open '.$file.' for read: permission denied'); $this->_mode = false; } } @@ -260,12 +260,12 @@ if (($imode == 'w' || $imode == 'a')) { if (file_exists($file)) { if (!is_writable($file)) { - $this->_dropError('Unable to open '.$file.' for write: permission denied'); + $this->dropError('Unable to open '.$file.' for write: permission denied'); $this->_mode = false; } } else { if (!@touch($file)) { - $this->_dropError('Unable to create '.$file.' for write: permission denied'); + $this->dropError('Unable to create '.$file.' for write: permission denied'); $this->_mode = false; } } @@ -275,7 +275,7 @@ $this->_FH = @fopen($file, $this->_mode); if (false === $this->_FH) { // Fallback; should never be reached if tests above are good enough! - $this->_dropError('Net_LDAP2_LDIF error: Could not open file '.$file); + $this->dropError('Net_LDAP2_LDIF error: Could not open file '.$file); } else { $this->_FH_opened = true; } @@ -330,7 +330,7 @@ foreach ($entries as $entry) { $this->_entrynum++; if (!$entry instanceof Net_LDAP2_Entry) { - $this->_dropError('Net_LDAP2_LDIF error: entry '.$this->_entrynum.' is not an Net_LDAP2_Entry object'); + $this->dropError('Net_LDAP2_LDIF error: entry '.$this->_entrynum.' is not an Net_LDAP2_Entry object'); } else { if ($this->_options['change']) { // LDIF change mode @@ -348,44 +348,44 @@ if (!$this->_version_written) { $this->write_version(); } - $this->_writeDN($entry->currentDN()); + $this->writeDN($entry->currentDN()); } // process changes // TODO: consider DN add! if ($entry->willBeDeleted()) { - $this->_writeLine("changetype: delete".PHP_EOL); + $this->writeLine("changetype: delete".PHP_EOL); } elseif ($entry->willBeMoved()) { - $this->_writeLine("changetype: modrdn".PHP_EOL); + $this->writeLine("changetype: modrdn".PHP_EOL); $olddn = Net_LDAP2_Util::ldap_explode_dn($entry->currentDN(), array('casefold' => 'none')); // maybe gives a bug if using multivalued RDNs $oldrdn = array_shift($olddn); $oldparent = implode(',', $olddn); $newdn = Net_LDAP2_Util::ldap_explode_dn($entry->dn(), array('casefold' => 'none')); // maybe gives a bug if using multivalued RDNs $rdn = array_shift($newdn); $parent = implode(',', $newdn); - $this->_writeLine("newrdn: ".$rdn.PHP_EOL); - $this->_writeLine("deleteoldrdn: 1".PHP_EOL); + $this->writeLine("newrdn: ".$rdn.PHP_EOL); + $this->writeLine("deleteoldrdn: 1".PHP_EOL); if ($parent !== $oldparent) { - $this->_writeLine("newsuperior: ".$parent.PHP_EOL); + $this->writeLine("newsuperior: ".$parent.PHP_EOL); } // TODO: What if the entry has attribute changes as well? // I think we should check for that and make a dummy // entry with the changes that is written to the LDIF file } elseif ($num_of_changes > 0) { // write attribute change data - $this->_writeLine("changetype: modify".PHP_EOL); + $this->writeLine("changetype: modify".PHP_EOL); foreach ($entry_attrs_changes as $changetype => $entry_attrs) { foreach ($entry_attrs as $attr_name => $attr_values) { - $this->_writeLine("$changetype: $attr_name".PHP_EOL); - if ($attr_values !== null) $this->_writeAttribute($attr_name, $attr_values, $changetype); - $this->_writeLine("-".PHP_EOL); + $this->writeLine("$changetype: $attr_name".PHP_EOL); + if ($attr_values !== null) $this->writeAttribute($attr_name, $attr_values, $changetype); + $this->writeLine("-".PHP_EOL); } } } // finish this entrys data if we had changes if ($is_changed) { - $this->_finishEntry(); + $this->finishEntry(); } } else { // LDIF-content mode @@ -406,11 +406,11 @@ if (!$this->_version_written) { $this->write_version(); } - $this->_writeDN($entry->dn()); + $this->writeDN($entry->dn()); foreach ($entry_attrs as $attr_name => $attr_values) { - $this->_writeAttribute($attr_name, $attr_values); + $this->writeAttribute($attr_name, $attr_values); } - $this->_finishEntry(); + $this->finishEntry(); } } } @@ -427,9 +427,9 @@ public function write_version() { $this->_version_written = true; - if (!is_null($this->version())) { - return $this->_writeLine('version: '.$this->version().PHP_EOL, 'Net_LDAP2_LDIF error: unable to write version'); - } + if (!is_null($this->version())) { + return $this->writeLine('version: '.$this->version().PHP_EOL, 'Net_LDAP2_LDIF error: unable to write version'); + } } /** @@ -447,7 +447,7 @@ { if ($version !== null) { if ($version != 1) { - $this->_dropError('Net_LDAP2_LDIF error: illegal LDIF version set'); + $this->dropError('Net_LDAP2_LDIF error: illegal LDIF version set'); } else { $this->_options['version'] = $version; } @@ -465,7 +465,7 @@ public function &handle() { if (!is_resource($this->_FH)) { - $this->_dropError('Net_LDAP2_LDIF error: invalid file resource'); + $this->dropError('Net_LDAP2_LDIF error: invalid file resource'); $null = null; return $null; } else { @@ -570,11 +570,11 @@ } elseif ($delim == ':<') { // file inclusion // TODO: Is this the job of the LDAP-client or the server? - $this->_dropError('File inclusions are currently not supported'); + $this->dropError('File inclusions are currently not supported'); //$attributes[$attr][] = ...; } else { // since the pattern above, the delimeter cannot be something else. - $this->_dropError('Net_LDAP2_LDIF parsing error: invalid syntax at parsing entry line: '.$line); + $this->dropError('Net_LDAP2_LDIF parsing error: invalid syntax at parsing entry line: '.$line); continue; } @@ -594,7 +594,7 @@ } if (false === $dn) { - $this->_dropError('Net_LDAP2_LDIF parsing error: unable to detect DN for entry'); + $this->dropError('Net_LDAP2_LDIF parsing error: unable to detect DN for entry'); return false; } else { $newentry = Net_LDAP2_Entry::createFresh($dn, $attributes); @@ -645,7 +645,7 @@ if ($data === false) { // error only, if EOF not reached after fgets() call if (!$this->eof()) { - $this->_dropError('Net_LDAP2_LDIF error: error reading from file at input line '.$this->_input_line, $this->_input_line); + $this->dropError('Net_LDAP2_LDIF error: error reading from file at input line '.$this->_input_line, $this->_input_line); } break; } else { @@ -692,7 +692,7 @@ if (!$commentmode) { if ($datalines_read == 0) { // first line of entry: wrapped data is illegal - $this->_dropError('Net_LDAP2_LDIF error: illegal wrapping at input line '.$this->_input_line, $this->_input_line); + $this->dropError('Net_LDAP2_LDIF error: illegal wrapping at input line '.$this->_input_line, $this->_input_line); } else { $last = array_pop($this->_lines_next); $last = $last.trim($matches[1]); @@ -708,7 +708,7 @@ // entry, so just ignore this line $commentmode = false; } else { - $this->_dropError('Net_LDAP2_LDIF error: invalid syntax at input line '.$this->_input_line, $this->_input_line); + $this->dropError('Net_LDAP2_LDIF error: invalid syntax at input line '.$this->_input_line, $this->_input_line); continue; } @@ -732,7 +732,7 @@ * @access protected * @return string LDIF string for that attribute and value */ - protected function _convertAttribute($attr_name, $attr_value) + protected function convertAttribute($attr_name, $attr_value) { // Handle empty attribute or process if (strlen($attr_value) == 0) { @@ -794,7 +794,7 @@ * @return string LDIF string for that DN * @todo I am not sure, if the UTF8 stuff is correctly handled right now */ - protected function _convertDN($dn) + protected function convertDN($dn) { $base64 = false; // ASCII-chars that are NOT safe for the @@ -835,15 +835,15 @@ * @access protected * @return void */ - protected function _writeAttribute($attr_name, $attr_values) + protected function writeAttribute($attr_name, $attr_values) { // write out attribute content if (!is_array($attr_values)) { $attr_values = array($attr_values); } foreach ($attr_values as $attr_val) { - $line = $this->_convertAttribute($attr_name, $attr_val).PHP_EOL; - $this->_writeLine($line, 'Net_LDAP2_LDIF error: unable to write attribute '.$attr_name.' of entry '.$this->_entrynum); + $line = $this->convertAttribute($attr_name, $attr_val).PHP_EOL; + $this->writeLine($line, 'Net_LDAP2_LDIF error: unable to write attribute '.$attr_name.' of entry '.$this->_entrynum); } } @@ -855,17 +855,17 @@ * @access protected * @return void */ - protected function _writeDN($dn) + protected function writeDN($dn) { // prepare DN if ($this->_options['encode'] == 'base64') { - $dn = $this->_convertDN($dn).PHP_EOL; + $dn = $this->convertDN($dn).PHP_EOL; } elseif ($this->_options['encode'] == 'canonical') { $dn = Net_LDAP2_Util::canonical_dn($dn, array('casefold' => 'none')).PHP_EOL; } else { $dn = $dn.PHP_EOL; } - $this->_writeLine($dn, 'Net_LDAP2_LDIF error: unable to write DN of entry '.$this->_entrynum); + $this->writeLine($dn, 'Net_LDAP2_LDIF error: unable to write DN of entry '.$this->_entrynum); } /** @@ -874,9 +874,9 @@ * @access protected * @return void */ - protected function _finishEntry() + protected function finishEntry() { - $this->_writeLine(PHP_EOL, 'Net_LDAP2_LDIF error: unable to close entry '.$this->_entrynum); + $this->writeLine(PHP_EOL, 'Net_LDAP2_LDIF error: unable to close entry '.$this->_entrynum); } /** @@ -888,10 +888,10 @@ * @access protected * @return true|false */ - protected function _writeLine($line, $error = 'Net_LDAP2_LDIF error: unable to write to filehandle') + protected function writeLine($line, $error = 'Net_LDAP2_LDIF error: unable to write to filehandle') { if (is_resource($this->handle()) && fwrite($this->handle(), $line, strlen($line)) === false) { - $this->_dropError($error); + $this->dropError($error); return false; } else { return true; @@ -907,7 +907,7 @@ * @access protected * @return void */ - protected function _dropError($msg, $line = null) + protected function dropError($msg, $line = null) { $this->_error['error'] = new Net_LDAP2_Error($msg); if ($line !== null) $this->_error['line'] = $line;
http://cvs.php.net/viewvc.cgi/pear/Net_LDAP2/LDAP2/LDIF.php?r1=1.7&r2=1.8&diff_format=u Index: pear/Net_LDAP2/LDAP2/LDIF.php diff -u pear/Net_LDAP2/LDAP2/LDIF.php:1.7 pear/Net_LDAP2/LDAP2/LDIF.php:1.8 --- pear/Net_LDAP2/LDAP2/LDIF.php:1.7 Thu Apr 30 07:36:21 2009 +++ pear/Net_LDAP2/LDAP2/LDIF.php Thu Apr 30 07:58:35 2009 @@ -10,7 +10,7 @@ * @author Benedikt Hallinger <beni@php.net> * @copyright 2009 Benedikt Hallinger * @license http://www.gnu.org/copyleft/lesser.html LGPL -* @version CVS: $Id: LDIF.php,v 1.7 2009/04/30 07:36:21 beni Exp $ +* @version CVS: $Id: LDIF.php,v 1.8 2009/04/30 07:58:35 beni Exp $ * @link http://pear.php.net/package/Net_LDAP2/ */ @@ -224,7 +224,7 @@ // todo: maybe implement further checks on possible values foreach ($options as $option => $value) { if (!array_key_exists($option, $this->_options)) { - $this->_dropError('Net_LDAP2_LDIF error: option '.$option.' not known!'); + $this->dropError('Net_LDAP2_LDIF error: option '.$option.' not known!'); return; } else { $this->_options[$option] = strtolower($value); @@ -236,7 +236,7 @@ // setup file mode if (!preg_match('/^[rwa]\+?$/', $mode)) { - $this->_dropError('Net_LDAP2_LDIF error: file mode '.$mode.' not supported!'); + $this->dropError('Net_LDAP2_LDIF error: file mode '.$mode.' not supported!'); } else { $this->_mode = $mode; @@ -248,11 +248,11 @@ $imode = substr($this->_mode, 0, 1); if ($imode == 'r') { if (!file_exists($file)) { - $this->_dropError('Unable to open '.$file.' for read: file not found'); + $this->dropError('Unable to open '.$file.' for read: file not found'); $this->_mode = false; } if (!is_readable($file)) { - $this->_dropError('Unable to open '.$file.' for read: permission denied'); + $this->dropError('Unable to open '.$file.' for read: permission denied'); $this->_mode = false; } } @@ -260,12 +260,12 @@ if (($imode == 'w' || $imode == 'a')) { if (file_exists($file)) { if (!is_writable($file)) { - $this->_dropError('Unable to open '.$file.' for write: permission denied'); + $this->dropError('Unable to open '.$file.' for write: permission denied'); $this->_mode = false; } } else { if (!@touch($file)) { - $this->_dropError('Unable to create '.$file.' for write: permission denied'); + $this->dropError('Unable to create '.$file.' for write: permission denied'); $this->_mode = false; } } @@ -275,7 +275,7 @@ $this->_FH = @fopen($file, $this->_mode); if (false === $this->_FH) { // Fallback; should never be reached if tests above are good enough! - $this->_dropError('Net_LDAP2_LDIF error: Could not open file '.$file); + $this->dropError('Net_LDAP2_LDIF error: Could not open file '.$file); } else { $this->_FH_opened = true; } @@ -330,7 +330,7 @@ foreach ($entries as $entry) { $this->_entrynum++; if (!$entry instanceof Net_LDAP2_Entry) { - $this->_dropError('Net_LDAP2_LDIF error: entry '.$this->_entrynum.' is not an Net_LDAP2_Entry object'); + $this->dropError('Net_LDAP2_LDIF error: entry '.$this->_entrynum.' is not an Net_LDAP2_Entry object'); } else { if ($this->_options['change']) { // LDIF change mode @@ -348,44 +348,44 @@ if (!$this->_version_written) { $this->write_version(); } - $this->_writeDN($entry->currentDN()); + $this->writeDN($entry->currentDN()); } // process changes // TODO: consider DN add! if ($entry->willBeDeleted()) { - $this->_writeLine("changetype: delete".PHP_EOL); + $this->writeLine("changetype: delete".PHP_EOL); } elseif ($entry->willBeMoved()) { - $this->_writeLine("changetype: modrdn".PHP_EOL); + $this->writeLine("changetype: modrdn".PHP_EOL); $olddn = Net_LDAP2_Util::ldap_explode_dn($entry->currentDN(), array('casefold' => 'none')); // maybe gives a bug if using multivalued RDNs $oldrdn = array_shift($olddn); $oldparent = implode(',', $olddn); $newdn = Net_LDAP2_Util::ldap_explode_dn($entry->dn(), array('casefold' => 'none')); // maybe gives a bug if using multivalued RDNs $rdn = array_shift($newdn); $parent = implode(',', $newdn); - $this->_writeLine("newrdn: ".$rdn.PHP_EOL); - $this->_writeLine("deleteoldrdn: 1".PHP_EOL); + $this->writeLine("newrdn: ".$rdn.PHP_EOL); + $this->writeLine("deleteoldrdn: 1".PHP_EOL); if ($parent !== $oldparent) { - $this->_writeLine("newsuperior: ".$parent.PHP_EOL); + $this->writeLine("newsuperior: ".$parent.PHP_EOL); } // TODO: What if the entry has attribute changes as well? // I think we should check for that and make a dummy // entry with the changes that is written to the LDIF file } elseif ($num_of_changes > 0) { // write attribute change data - $this->_writeLine("changetype: modify".PHP_EOL); + $this->writeLine("changetype: modify".PHP_EOL); foreach ($entry_attrs_changes as $changetype => $entry_attrs) { foreach ($entry_attrs as $attr_name => $attr_values) { - $this->_writeLine("$changetype: $attr_name".PHP_EOL); - if ($attr_values !== null) $this->_writeAttribute($attr_name, $attr_values, $changetype); - $this->_writeLine("-".PHP_EOL); + $this->writeLine("$changetype: $attr_name".PHP_EOL); + if ($attr_values !== null) $this->writeAttribute($attr_name, $attr_values, $changetype); + $this->writeLine("-".PHP_EOL); } } } // finish this entrys data if we had changes if ($is_changed) { - $this->_finishEntry(); + $this->finishEntry(); } } else { // LDIF-content mode @@ -406,11 +406,11 @@ if (!$this->_version_written) { $this->write_version(); } - $this->_writeDN($entry->dn()); + $this->writeDN($entry->dn()); foreach ($entry_attrs as $attr_name => $attr_values) { - $this->_writeAttribute($attr_name, $attr_values); + $this->writeAttribute($attr_name, $attr_values); } - $this->_finishEntry(); + $this->finishEntry(); } } } @@ -427,9 +427,9 @@ public function write_version() { $this->_version_written = true; - if (!is_null($this->version())) { - return $this->_writeLine('version: '.$this->version().PHP_EOL, 'Net_LDAP2_LDIF error: unable to write version'); - } + if (!is_null($this->version())) { + return $this->writeLine('version: '.$this->version().PHP_EOL, 'Net_LDAP2_LDIF error: unable to write version'); + } } /** @@ -447,7 +447,7 @@ { if ($version !== null) { if ($version != 1) { - $this->_dropError('Net_LDAP2_LDIF error: illegal LDIF version set'); + $this->dropError('Net_LDAP2_LDIF error: illegal LDIF version set'); } else { $this->_options['version'] = $version; } @@ -465,7 +465,7 @@ public function &handle() { if (!is_resource($this->_FH)) { - $this->_dropError('Net_LDAP2_LDIF error: invalid file resource'); + $this->dropError('Net_LDAP2_LDIF error: invalid file resource'); $null = null; return $null; } else { @@ -570,11 +570,11 @@ } elseif ($delim == ':<') { // file inclusion // TODO: Is this the job of the LDAP-client or the server? - $this->_dropError('File inclusions are currently not supported'); + $this->dropError('File inclusions are currently not supported'); //$attributes[$attr][] = ...; } else { // since the pattern above, the delimeter cannot be something else. - $this->_dropError('Net_LDAP2_LDIF parsing error: invalid syntax at parsing entry line: '.$line); + $this->dropError('Net_LDAP2_LDIF parsing error: invalid syntax at parsing entry line: '.$line); continue; } @@ -594,7 +594,7 @@ } if (false === $dn) { - $this->_dropError('Net_LDAP2_LDIF parsing error: unable to detect DN for entry'); + $this->dropError('Net_LDAP2_LDIF parsing error: unable to detect DN for entry'); return false; } else { $newentry = Net_LDAP2_Entry::createFresh($dn, $attributes); @@ -645,7 +645,7 @@ if ($data === false) { // error only, if EOF not reached after fgets() call if (!$this->eof()) { - $this->_dropError('Net_LDAP2_LDIF error: error reading from file at input line '.$this->_input_line, $this->_input_line); + $this->dropError('Net_LDAP2_LDIF error: error reading from file at input line '.$this->_input_line, $this->_input_line); } break; } else { @@ -692,7 +692,7 @@ if (!$commentmode) { if ($datalines_read == 0) { // first line of entry: wrapped data is illegal - $this->_dropError('Net_LDAP2_LDIF error: illegal wrapping at input line '.$this->_input_line, $this->_input_line); + $this->dropError('Net_LDAP2_LDIF error: illegal wrapping at input line '.$this->_input_line, $this->_input_line); } else { $last = array_pop($this->_lines_next); $last = $last.trim($matches[1]); @@ -708,7 +708,7 @@ // entry, so just ignore this line $commentmode = false; } else { - $this->_dropError('Net_LDAP2_LDIF error: invalid syntax at input line '.$this->_input_line, $this->_input_line); + $this->dropError('Net_LDAP2_LDIF error: invalid syntax at input line '.$this->_input_line, $this->_input_line); continue; } @@ -732,7 +732,7 @@ * @access protected * @return string LDIF string for that attribute and value */ - protected function _convertAttribute($attr_name, $attr_value) + protected function convertAttribute($attr_name, $attr_value) { // Handle empty attribute or process if (strlen($attr_value) == 0) { @@ -794,7 +794,7 @@ * @return string LDIF string for that DN * @todo I am not sure, if the UTF8 stuff is correctly handled right now */ - protected function _convertDN($dn) + protected function convertDN($dn) { $base64 = false; // ASCII-chars that are NOT safe for the @@ -835,15 +835,15 @@ * @access protected * @return void */ - protected function _writeAttribute($attr_name, $attr_values) + protected function writeAttribute($attr_name, $attr_values) { // write out attribute content if (!is_array($attr_values)) { $attr_values = array($attr_values); } foreach ($attr_values as $attr_val) { - $line = $this->_convertAttribute($attr_name, $attr_val).PHP_EOL; - $this->_writeLine($line, 'Net_LDAP2_LDIF error: unable to write attribute '.$attr_name.' of entry '.$this->_entrynum); + $line = $this->convertAttribute($attr_name, $attr_val).PHP_EOL; + $this->writeLine($line, 'Net_LDAP2_LDIF error: unable to write attribute '.$attr_name.' of entry '.$this->_entrynum); } } @@ -855,17 +855,17 @@ * @access protected * @return void */ - protected function _writeDN($dn) + protected function writeDN($dn) { // prepare DN if ($this->_options['encode'] == 'base64') { - $dn = $this->_convertDN($dn).PHP_EOL; + $dn = $this->convertDN($dn).PHP_EOL; } elseif ($this->_options['encode'] == 'canonical') { $dn = Net_LDAP2_Util::canonical_dn($dn, array('casefold' => 'none')).PHP_EOL; } else { $dn = $dn.PHP_EOL; } - $this->_writeLine($dn, 'Net_LDAP2_LDIF error: unable to write DN of entry '.$this->_entrynum); + $this->writeLine($dn, 'Net_LDAP2_LDIF error: unable to write DN of entry '.$this->_entrynum); } /** @@ -874,9 +874,9 @@ * @access protected * @return void */ - protected function _finishEntry() + protected function finishEntry() { - $this->_writeLine(PHP_EOL, 'Net_LDAP2_LDIF error: unable to close entry '.$this->_entrynum); + $this->writeLine(PHP_EOL, 'Net_LDAP2_LDIF error: unable to close entry '.$this->_entrynum); } /** @@ -888,10 +888,10 @@ * @access protected * @return true|false */ - protected function _writeLine($line, $error = 'Net_LDAP2_LDIF error: unable to write to filehandle') + protected function writeLine($line, $error = 'Net_LDAP2_LDIF error: unable to write to filehandle') { if (is_resource($this->handle()) && fwrite($this->handle(), $line, strlen($line)) === false) { - $this->_dropError($error); + $this->dropError($error); return false; } else { return true; @@ -907,7 +907,7 @@ * @access protected * @return void */ - protected function _dropError($msg, $line = null) + protected function dropError($msg, $line = null) { $this->_error['error'] = new Net_LDAP2_Error($msg); if ($line !== null) $this->_error['line'] = $line;