cvs: pear /File_Archive Archive.php /File_Archive/Archive Reader.php Writer.php /File_Archive/Archive/Writer Mail.php Memory.php Multi.php
Output.php

From: Date: Mon, 30 May 2005 15:25:15 +0000
Subject: cvs: pear /File_Archive Archive.php /File_Archive/Archive Reader.php Writer.php /File_Archive/Archive/Writer Mail.php Memory.php Multi.php
Output.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-32250@lists.php.net to get a copy of this message
vincentlascaux Mon May 30 11:25:15 2005 EDT Modified files: /pear/File_Archive Archive.php /pear/File_Archive/Archive Reader.php Writer.php /pear/File_Archive/Archive/Writer Mail.php Memory.php Multi.php Output.php Log: Don't use the getMime function when it's not needed (and its only needed by mail, output and memory writers) http://cvs.php.net/diff.php/pear/File_Archive/Archive.php?r1=1.56&r2=1.57&ty=u Index: pear/File_Archive/Archive.php diff -u pear/File_Archive/Archive.php:1.56 pear/File_Archive/Archive.php:1.57 --- pear/File_Archive/Archive.php:1.56 Mon May 30 10:12:58 2005 +++ pear/File_Archive/Archive.php Mon May 30 11:25:14 2005 @@ -27,7 +27,7 @@ * @author Vincent Lascaux <vincentlascaux@php.net> * @copyright 1997-2005 The PHP Group * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @version CVS: $Id: Archive.php,v 1.56 2005/05/30 14:12:58 vincentlascaux Exp $ + * @version CVS: $Id: Archive.php,v 1.57 2005/05/30 15:25:14 vincentlascaux Exp $ * @link http://pear.php.net/package/File_Archive */ @@ -984,13 +984,6 @@ */ function removeFromSource(&$pred, &$source, $URL = null) { - echo "pred\n"; - var_dump($pred); - echo "source\n"; - var_dump($source); - echo "URL\n"; - var_dump($URL); - if (PEAR::isError($source)) { return $source; } http://cvs.php.net/diff.php/pear/File_Archive/Archive/Reader.php?r1=1.28&r2=1.29&ty=u Index: pear/File_Archive/Archive/Reader.php diff -u pear/File_Archive/Archive/Reader.php:1.28 pear/File_Archive/Archive/Reader.php:1.29 --- pear/File_Archive/Archive/Reader.php:1.28 Sun May 29 08:42:17 2005 +++ pear/File_Archive/Archive/Reader.php Mon May 30 11:25:14 2005 @@ -27,7 +27,7 @@ * @author Vincent Lascaux <vincentlascaux@php.net> * @copyright 1997-2005 The PHP Group * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @version CVS: $Id: Reader.php,v 1.28 2005/05/29 12:42:17 vincentlascaux Exp $ + * @version CVS: $Id: Reader.php,v 1.29 2005/05/30 15:25:14 vincentlascaux Exp $ * @link http://pear.php.net/package/File_Archive */ @@ -271,10 +271,15 @@ } while (($error = $this->next()) === true) { + if ($writer->newFileNeedsMIME()) { + $mime = $this->getMime(); + } else { + $mime = null; + } $error = $writer->newFile( $this->getFilename(), $this->getStat(), - $this->getMime() + $mime ); if (PEAR::isError($error)) { break; http://cvs.php.net/diff.php/pear/File_Archive/Archive/Writer.php?r1=1.10&r2=1.11&ty=u Index: pear/File_Archive/Archive/Writer.php diff -u pear/File_Archive/Archive/Writer.php:1.10 pear/File_Archive/Archive/Writer.php:1.11 --- pear/File_Archive/Archive/Writer.php:1.10 Sun Apr 17 08:27:32 2005 +++ pear/File_Archive/Archive/Writer.php Mon May 30 11:25:14 2005 @@ -25,7 +25,7 @@ * @author Vincent Lascaux <vincentlascaux@php.net> * @copyright 1997-2005 The PHP Group * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @version CVS: $Id: Writer.php,v 1.10 2005/04/17 12:27:32 vincentlascaux Exp $ + * @version CVS: $Id: Writer.php,v 1.11 2005/05/30 15:25:14 vincentlascaux Exp $ * @link http://pear.php.net/package/File_Archive */ @@ -70,6 +70,15 @@ } /** + * Returns whether the writer newFile function needs the $mime parameter + * Default is false + */ + function newFileNeedsMIME() + { + return false; + } + + /** * Append the specified data to the writer * * @param String $data the data to append to the writer http://cvs.php.net/diff.php/pear/File_Archive/Archive/Writer/Mail.php?r1=1.9&r2=1.10&ty=u Index: pear/File_Archive/Archive/Writer/Mail.php diff -u pear/File_Archive/Archive/Writer/Mail.php:1.9 pear/File_Archive/Archive/Writer/Mail.php:1.10 --- pear/File_Archive/Archive/Writer/Mail.php:1.9 Fri Apr 8 06:18:06 2005 +++ pear/File_Archive/Archive/Writer/Mail.php Mon May 30 11:25:14 2005 @@ -25,7 +25,7 @@ * @author Vincent Lascaux <vincentlascaux@php.net> * @copyright 1997-2005 The PHP Group * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @version CVS: $Id: Mail.php,v 1.9 2005/04/08 10:18:06 vincentlascaux Exp $ + * @version CVS: $Id: Mail.php,v 1.10 2005/05/30 15:25:14 vincentlascaux Exp $ * @link http://pear.php.net/package/File_Archive */ @@ -162,6 +162,13 @@ $this->currentFilename = $filename; $this->currentMime = $mime; } + /** + * @see File_Archive_Writer::newFileNeedsMIME() + */ + function newFileNeedsMIME() + { + return true; + } /** * @see File_Archive_Writer::close() http://cvs.php.net/diff.php/pear/File_Archive/Archive/Writer/Memory.php?r1=1.12&r2=1.13&ty=u Index: pear/File_Archive/Archive/Writer/Memory.php diff -u pear/File_Archive/Archive/Writer/Memory.php:1.12 pear/File_Archive/Archive/Writer/Memory.php:1.13 --- pear/File_Archive/Archive/Writer/Memory.php:1.12 Wed May 4 09:53:40 2005 +++ pear/File_Archive/Archive/Writer/Memory.php Mon May 30 11:25:14 2005 @@ -25,7 +25,7 @@ * @author Vincent Lascaux <vincentlascaux@php.net> * @copyright 1997-2005 The PHP Group * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @version CVS: $Id: Memory.php,v 1.12 2005/05/04 13:53:40 vincentlascaux Exp $ + * @version CVS: $Id: Memory.php,v 1.13 2005/05/30 15:25:14 vincentlascaux Exp $ * @link http://pear.php.net/package/File_Archive */ @@ -76,6 +76,13 @@ $this->stat = $stat; $this->mime = $mime; } + /** + * @see File_Archive_Writer::newFileNeedsMIME + */ + function newFileNeedsMIME() + { + return true; + } /** * Retrieve the concatenated data http://cvs.php.net/diff.php/pear/File_Archive/Archive/Writer/Multi.php?r1=1.7&r2=1.8&ty=u Index: pear/File_Archive/Archive/Writer/Multi.php diff -u pear/File_Archive/Archive/Writer/Multi.php:1.7 pear/File_Archive/Archive/Writer/Multi.php:1.8 --- pear/File_Archive/Archive/Writer/Multi.php:1.7 Thu May 26 11:57:37 2005 +++ pear/File_Archive/Archive/Writer/Multi.php Mon May 30 11:25:14 2005 @@ -25,7 +25,7 @@ * @author Vincent Lascaux <vincentlascaux@php.net> * @copyright 1997-2005 The PHP Group * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @version CVS: $Id: Multi.php,v 1.7 2005/05/26 15:57:37 vincentlascaux Exp $ + * @version CVS: $Id: Multi.php,v 1.8 2005/05/30 15:25:14 vincentlascaux Exp $ * @link http://pear.php.net/package/File_Archive */ @@ -63,6 +63,14 @@ return $errorB; } } + /** + * @see File_Archive_Writer::newFileNeedsMIME() + */ + function newFileNeedsMIME() + { + return $this->a->newFileNeedsMIME() || + $this->b->newFileNeedsMIME(); + } /** * @see File_Archive_Writer::writeData() http://cvs.php.net/diff.php/pear/File_Archive/Archive/Writer/Output.php?r1=1.7&r2=1.8&ty=u Index: pear/File_Archive/Archive/Writer/Output.php diff -u pear/File_Archive/Archive/Writer/Output.php:1.7 pear/File_Archive/Archive/Writer/Output.php:1.8 --- pear/File_Archive/Archive/Writer/Output.php:1.7 Wed May 25 13:26:44 2005 +++ pear/File_Archive/Archive/Writer/Output.php Mon May 30 11:25:14 2005 @@ -27,7 +27,7 @@ * @author Vincent Lascaux <vincentlascaux@php.net> * @copyright 1997-2005 The PHP Group * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @version CVS: $Id: Output.php,v 1.7 2005/05/25 17:26:44 vincentlascaux Exp $ + * @version CVS: $Id: Output.php,v 1.8 2005/05/30 15:25:14 vincentlascaux Exp $ * @link http://pear.php.net/package/File_Archive */ @@ -74,6 +74,13 @@ } } /** + * @see File_Archive_Writer::newFileNeedsMIME + */ + function newFileNeedsMIME() + { + return $this->sendHeaders; + } + /** * @see File_Archive_Writer::writeData() */ function writeData($data) { echo $data; }

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