Bearsampp 2026.9.23
Loading...
Searching...
No Matches
Parser.php
Go to the documentation of this file.
1<?php
15
19require_once 'PEAR/XMLParser.php';
20require_once 'PEAR/ChannelFile.php';
33{
37
38 function setConfig(&$c)
39 {
40 $this->_config = &$c;
41 $this->_registry = &$c->getRegistry();
42 }
43
44 function setLogger(&$l)
45 {
46 $this->_logger = &$l;
47 }
48
49 function parse($data, $file)
50 {
51 if (PEAR::isError($err = parent::parse($data, $file))) {
52 return $err;
53 }
54
55 $ret = new PEAR_ChannelFile;
56 $ret->setConfig($this->_config);
57 if (isset($this->_logger)) {
58 $ret->setLogger($this->_logger);
59 }
60
61 $ret->fromArray($this->_unserializedData);
62 // make sure the filelist is in the easy to read format needed
63 $ret->flattenFilelist();
64 $ret->setPackagefile($file, $archive);
65 return $ret;
66 }
67}
parse($data, $file)
Definition Parser.php:49
static & fromArray( $data, $compatibility=false, $stackClass='PEAR_ErrorStack')