/** * Get a file from apk Archive by name. * * @param string $name * @param int $length * @param int $flags * @return mixed */ public function getFromName($name, $length = NULL, $flags = NULL) { if (strtolower(substr($name, -4)) == '.xml') { $xmlParser = new XmlParser(new Stream($this->getStream($name))); return $xmlParser->getXmlString(); } else { return parent::getFromName($name, $length, $flags); } }
public static function decompressFile($file, $destination = NULL) { if (!is_file($file)) { throw new Exception("{$file} is not a regular file"); } $parser = new XmlParser(new Stream(fopen($file, 'rd'))); //TODO : write a method in this class, ->saveToFile(); file_put_contents($destination === NULL ? $file : $destination, $parser->getXmlString()); }