cvs: php4 /pear/PEAR Packager.php

From: Date: Fri, 06 Jul 2001 19:23:42 +0000
Subject: cvs: php4 /pear/PEAR Packager.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-213@lists.php.net to get a copy of this message
cox Fri Jul 6 15:23:42 2001 EDT Modified files: /php4/pear/PEAR Packager.php Log: whitespaces Index: php4/pear/PEAR/Packager.php diff -u php4/pear/PEAR/Packager.php:1.4 php4/pear/PEAR/Packager.php:1.5 --- php4/pear/PEAR/Packager.php:1.4 Mon May 28 02:31:03 2001 +++ php4/pear/PEAR/Packager.php Fri Jul 6 15:23:41 2001 @@ -93,7 +93,7 @@ // {{{ destructor function _PEAR_Packager() { - $this->_PEAR(); + $this->_PEAR(); while (is_array($this->_tempfiles) && $file = array_shift($this->_tempfiles)) { @@ -117,19 +117,19 @@ return $this->raiseError($php_errormsg); } - $xp = xml_parser_create(); - if (!$xp) { - return $this->raiseError("Unable to create XML parser."); - } - xml_set_object($xp, $this); - xml_set_element_handler($xp, "startHandler", "endHandler"); - xml_set_character_data_handler($xp, "charHandler"); - xml_parser_set_option($xp, XML_OPTION_CASE_FOLDING, false); - xml_parser_set_option($xp, XML_OPTION_TARGET_ENCODING, "UTF-8"); - - $this->element_stack = array(); - $this->pkginfo = array(); - $this->current_element = false; + $xp = xml_parser_create(); + if (!$xp) { + return $this->raiseError("Unable to create XML parser."); + } + xml_set_object($xp, $this); + xml_set_element_handler($xp, "startHandler", "endHandler"); + xml_set_character_data_handler($xp, "charHandler"); + xml_parser_set_option($xp, XML_OPTION_CASE_FOLDING, false); + xml_parser_set_option($xp, XML_OPTION_TARGET_ENCODING, "UTF-8"); + + $this->element_stack = array(); + $this->pkginfo = array(); + $this->current_element = false; $data = fread($fp, filesize($pkgfile)); fclose($fp); @@ -139,8 +139,8 @@ xml_get_current_line_number($xp)); xml_parser_free($xp); return $this->raiseError($msg); - } - xml_parser_free($xp); + } + xml_parser_free($xp); $pkginfofile = $this->tmpdir . DIRECTORY_SEPARATOR . "package.xml"; $fp = fopen($pkginfofile, "w"); @@ -214,9 +214,9 @@ function startHandler($xp, $name, $attribs) { - array_push($this->element_stack, $name); - $this->current_element = $name; - $this->current_attributes = $attribs; + array_push($this->element_stack, $name); + $this->current_element = $name; + $this->current_attributes = $attribs; $this->tmpdata = ''; if ($this->recordfilelist) { $this->filelist .= "<$name"; @@ -225,12 +225,12 @@ } $this->filelist .= ">"; } - switch ($name) { - case "Package": + switch ($name) { + case "Package": if ($attribs["Type"]) { // warning } - break; + break; case "FileList": // XXX FIXME Windows $this->recordfilelist = true; @@ -252,7 +252,7 @@ } $this->_tempfiles[] = $this->tmpdir; break; - } + } } // }}} @@ -260,8 +260,8 @@ function endHandler($xp, $name) { - array_pop($this->element_stack); - $this->current_element = $this->element_stack[sizeof($this->element_stack)-1]; + array_pop($this->element_stack); + $this->current_element = $this->element_stack[sizeof($this->element_stack)-1]; switch ($name) { case "FileList": $this->recordfilelist = false; @@ -280,10 +280,10 @@ if ($this->recordfilelist) { $this->filelist .= $data; } - switch ($this->current_element) { - case "Dir": - break; - case "File": + switch ($this->current_element) { + case "Dir": + break; + case "File": $file = "$this->tmpdir/$data"; $dir = dirname($file); if (!is_dir($dir)) { @@ -303,7 +303,7 @@ $this->pkginfo[$id] = $data; } break; - } + } } // }}}

« previous php.pear.cvs (#213) next »