#39574 [Opn->Bgs]: ZipArchive::renameName won't accept variables for file names

From: Date: Tue, 21 Nov 2006 22:48:27 +0000
Subject: #39574 [Opn->Bgs]: ZipArchive::renameName won't accept variables for file names
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-105273@lists.php.net to get a copy of this message
ID: 39574 User updated by: damon dot dean at revcube dot com Reported By: damon dot dean at revcube dot com -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Mac OS X PHP Version: 5.2.0 New Comment: I'm going to retract this. I'm not sure that I should even be trying to call this function and renaming before extracting the file. Previous Comments: ------------------------------------------------------------------------ [2006-11-21 22:23:59] damon dot dean at revcube dot com Description: ------------ I'm not sure if this is a bug, or by design, but this function works differently than others I've seen in PHP. No matter I try, if I try to pass a file name as a variable to ZipArchive::renameName, it prints the name of the variable as the filename, rather than the value of the variable. Reproduce code: --------------- <?php $logDateTime = date('Y_m_d_H_i_s'); $CSVFileName = "HGN_GGL"._."$logDateTime".".csv"; $zip = new ZipArchive; if ($zip->open('./reports/report-csv.zip') === TRUE) { //Also tried '' and ""with function below $zip->renameName('report.csv', $CSVFileName); $zip->extractTo('./reports'); echo "Yay!"; } else { echo "Boo"; } ?> Expected result: ---------------- I would expect it to output a file with a name along the lines of this: HGN_GGL_2006_11_21_14_17_07.csv Actual result: -------------- Instead, it produces a file name like this: $CSVFileName ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=39574&edit=1

« previous php.bugs (#105273) next »