cvs: pear /File_Archive/Archive/Reader Ar.php /File_Archive/Archive/Writer Ar.php

From: Date: Thu, 26 May 2005 15:27:14 +0000
Subject: cvs: pear /File_Archive/Archive/Reader Ar.php /File_Archive/Archive/Writer Ar.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-32131@lists.php.net to get a copy of this message
pfischer Thu May 26 11:27:14 2005 EDT Modified files: /pear/File_Archive/Archive/Reader Ar.php /pear/File_Archive/Archive/Writer Ar.php Log: - Ar file formats don't have support for directories, you can't add a file like: foobar/foo.something. Fixed - Added the makeWriter method to the reader http://cvs.php.net/diff.php/pear/File_Archive/Archive/Reader/Ar.php?r1=1.5&r2=1.6&ty=u Index: pear/File_Archive/Archive/Reader/Ar.php diff -u pear/File_Archive/Archive/Reader/Ar.php:1.5 pear/File_Archive/Archive/Reader/Ar.php:1.6 --- pear/File_Archive/Archive/Reader/Ar.php:1.5 Mon May 23 11:49:00 2005 +++ pear/File_Archive/Archive/Reader/Ar.php Thu May 26 11:27:14 2005 @@ -192,5 +192,18 @@ return $this->source->getData($length); } } + + /** + * @see File_Archive_Reader::makeWriter + */ + function makeWriter($seek = 0, $fileModif = true) + { + require_once "File/Archive/Writer/Ar.php"; + + $writer = $this->source->makeWriter(); + $this->source = null; + $this->close(); + return new File_Archive_Writer_Ar(null, $writer); + } } ?> \ No newline at end of file http://cvs.php.net/diff.php/pear/File_Archive/Archive/Writer/Ar.php?r1=1.8&r2=1.9&ty=u Index: pear/File_Archive/Archive/Writer/Ar.php diff -u pear/File_Archive/Archive/Writer/Ar.php:1.8 pear/File_Archive/Archive/Writer/Ar.php:1.9 --- pear/File_Archive/Archive/Writer/Ar.php:1.8 Mon May 23 17:44:59 2005 +++ pear/File_Archive/Archive/Writer/Ar.php Thu May 26 11:27:14 2005 @@ -151,13 +151,17 @@ $mime = "application/octet-stream") { $this->flush(); - echo $filename."<br />"; /** * If the file is empty, there's no reason to have a buffer * or use memory */ $this->_useBuffer = !isset($stats[7]); - $this->_currentFilename = $filename; + /** + * Becaue ar fileformats doesn't support files in directories, + * then we need to just save with the filename an ommit the + * directory + */ + $this->_currentFilename = basename($filename); $this->_currentStat = $stat; if(!$this->_useBuffer) {

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