cvs: pecl4win / get_all.php
| From: | Edin Kadribasic | Date: | Wed, 04 Oct 2006 08:53:51 +0000 |
| Subject: | cvs: pecl4win / get_all.php | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-6455@lists.php.net to get a copy of this message | ||
edink Wed Oct 4 08:53:51 2006 UTC
Modified files:
/pecl4win get_all.php
Log:
Finalize zip functionality
http://cvs.php.net/viewvc.cgi/pecl4win/get_all.php?r1=1.2&r2=1.3&diff_format=u
Index: pecl4win/get_all.php
diff -u pecl4win/get_all.php:1.2 pecl4win/get_all.php:1.3
--- pecl4win/get_all.php:1.2 Sat Aug 12 21:58:15 2006
+++ pecl4win/get_all.php Wed Oct 4 08:53:51 2006
@@ -1,13 +1,17 @@
<?php
-/* $Id: get_all.php,v 1.2 2006/08/12 21:58:15 edink Exp $ */
+/* $Id: get_all.php,v 1.3 2006/10/04 08:53:51 edink Exp $ */
if (!defined("SITE_ROOT")) {
- define("SITE_ROOT", dirname(__FILE__));
+ define("SITE_ROOT", dirname(__FILE__));
}
include SITE_ROOT."/lib/includes/init.php";
$args = explode("/", $_SERVER['PATH_INFO']);
$branch = $args[1];
+if (!preg_match('|^\\d_\\d$|', $branch)) {
+ http::notFound();
+}
+
$q = safe_sql_str("select fname, content from ext where row(fname, updated) in (select fname,
max(updated) from ext where branch=!s group by fname)", $branch);
$tmpzipname = tempnam("/tmp", "pecl4winzip");
@@ -15,15 +19,15 @@
$zip = new ZipArchive;
if (true != $zip->open($tmpzipname, ZipArchive::CREATE)) {
- http::notFound();
+ http::notFound();
}
$res = $DB->query($q);
while ($row = $DB->fetchRow($res)) {
- $file = new stdClass;
- $DB->loadFromDbRow($file, $res, $row);
- $zip->addFromString("pecl4win_$branch/" . $file->fname, $file->content);
+ $file = new stdClass;
+ $DB->loadFromDbRow($file, $res, $row);
+ $zip->addFromString("pecl4win_$branch/" . $file->fname, $file->content);
}
$zip->close();