@@ -93,7 +93,7 @@ function PEAR_Packager($phpdir = PEAR_INSTALL_DIR,
93
93
// {{{ destructor
94
94
95
95
function _PEAR_Packager () {
96
- $ this ->_PEAR ();
96
+ $ this ->_PEAR ();
97
97
while (is_array ($ this ->_tempfiles ) &&
98
98
$ file = array_shift ($ this ->_tempfiles ))
99
99
{
@@ -117,19 +117,19 @@ function package($pkgfile = "package.xml")
117
117
return $ this ->raiseError ($ php_errormsg );
118
118
}
119
119
120
- $ xp = xml_parser_create ();
121
- if (!$ xp ) {
122
- return $ this ->raiseError ("Unable to create XML parser. " );
123
- }
124
- xml_set_object ($ xp , $ this );
125
- xml_set_element_handler ($ xp , "startHandler " , "endHandler " );
126
- xml_set_character_data_handler ($ xp , "charHandler " );
127
- xml_parser_set_option ($ xp , XML_OPTION_CASE_FOLDING , false );
128
- xml_parser_set_option ($ xp , XML_OPTION_TARGET_ENCODING , "UTF-8 " );
129
-
130
- $ this ->element_stack = array ();
131
- $ this ->pkginfo = array ();
132
- $ this ->current_element = false ;
120
+ $ xp = xml_parser_create ();
121
+ if (!$ xp ) {
122
+ return $ this ->raiseError ("Unable to create XML parser. " );
123
+ }
124
+ xml_set_object ($ xp , $ this );
125
+ xml_set_element_handler ($ xp , "startHandler " , "endHandler " );
126
+ xml_set_character_data_handler ($ xp , "charHandler " );
127
+ xml_parser_set_option ($ xp , XML_OPTION_CASE_FOLDING , false );
128
+ xml_parser_set_option ($ xp , XML_OPTION_TARGET_ENCODING , "UTF-8 " );
129
+
130
+ $ this ->element_stack = array ();
131
+ $ this ->pkginfo = array ();
132
+ $ this ->current_element = false ;
133
133
134
134
$ data = fread ($ fp , filesize ($ pkgfile ));
135
135
fclose ($ fp );
@@ -139,8 +139,8 @@ function package($pkgfile = "package.xml")
139
139
xml_get_current_line_number ($ xp ));
140
140
xml_parser_free ($ xp );
141
141
return $ this ->raiseError ($ msg );
142
- }
143
- xml_parser_free ($ xp );
142
+ }
143
+ xml_parser_free ($ xp );
144
144
145
145
$ pkginfofile = $ this ->tmpdir . DIRECTORY_SEPARATOR . "package.xml " ;
146
146
$ fp = fopen ($ pkginfofile , "w " );
@@ -214,9 +214,9 @@ function log($level, $msg)
214
214
215
215
function startHandler ($ xp , $ name , $ attribs )
216
216
{
217
- array_push ($ this ->element_stack , $ name );
218
- $ this ->current_element = $ name ;
219
- $ this ->current_attributes = $ attribs ;
217
+ array_push ($ this ->element_stack , $ name );
218
+ $ this ->current_element = $ name ;
219
+ $ this ->current_attributes = $ attribs ;
220
220
$ this ->tmpdata = '' ;
221
221
if ($ this ->recordfilelist ) {
222
222
$ this ->filelist .= "< $ name " ;
@@ -225,12 +225,12 @@ function startHandler($xp, $name, $attribs)
225
225
}
226
226
$ this ->filelist .= "> " ;
227
227
}
228
- switch ($ name ) {
229
- case "Package " :
228
+ switch ($ name ) {
229
+ case "Package " :
230
230
if ($ attribs ["Type " ]) {
231
231
// warning
232
232
}
233
- break ;
233
+ break ;
234
234
case "FileList " :
235
235
// XXX FIXME Windows
236
236
$ this ->recordfilelist = true ;
@@ -252,16 +252,16 @@ function startHandler($xp, $name, $attribs)
252
252
}
253
253
$ this ->_tempfiles [] = $ this ->tmpdir ;
254
254
break ;
255
- }
255
+ }
256
256
}
257
257
258
258
// }}}
259
259
// {{{ endHandler()
260
260
261
261
function endHandler ($ xp , $ name )
262
262
{
263
- array_pop ($ this ->element_stack );
264
- $ this ->current_element = $ this ->element_stack [sizeof ($ this ->element_stack )-1 ];
263
+ array_pop ($ this ->element_stack );
264
+ $ this ->current_element = $ this ->element_stack [sizeof ($ this ->element_stack )-1 ];
265
265
switch ($ name ) {
266
266
case "FileList " :
267
267
$ this ->recordfilelist = false ;
@@ -280,10 +280,10 @@ function charHandler($xp, $data)
280
280
if ($ this ->recordfilelist ) {
281
281
$ this ->filelist .= $ data ;
282
282
}
283
- switch ($ this ->current_element ) {
284
- case "Dir " :
285
- break ;
286
- case "File " :
283
+ switch ($ this ->current_element ) {
284
+ case "Dir " :
285
+ break ;
286
+ case "File " :
287
287
$ file = "$ this ->tmpdir / $ data " ;
288
288
$ dir = dirname ($ file );
289
289
if (!is_dir ($ dir )) {
@@ -303,7 +303,7 @@ function charHandler($xp, $data)
303
303
$ this ->pkginfo [$ id ] = $ data ;
304
304
}
305
305
break ;
306
- }
306
+ }
307
307
}
308
308
309
309
// }}}
0 commit comments