[geeklog-cvs] geeklog: Zip::extract() returns an array on success and 0 on fai...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun Apr 5 12:53:47 EDT 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/4b8a086e07af
changeset: 6894:4b8a086e07af
user:      Dirk Haun <dirk at haun-online.de>
date:      Sun Apr 05 18:16:08 2009 +0200
description:
Zip::extract() returns an array on success and 0 on failure

diffstat:

1 file changed, 9 insertions(+), 3 deletions(-)
system/classes/unpacker.class.php |   12 +++++++++---

diffs (28 lines):

diff -r 1677c239fcc6 -r 4b8a086e07af system/classes/unpacker.class.php
--- a/system/classes/unpacker.class.php	Sun Apr 05 15:38:29 2009 +0200
+++ b/system/classes/unpacker.class.php	Sun Apr 05 18:16:08 2009 +0200
@@ -382,9 +382,15 @@
         } else {
             
             if (is_array($item_array) === true) {
-                return $this->archive->extract(array('add_path' => $target_path, 'by_name' => $item_array));
+                $result = $this->archive->extract(array('add_path' => $target_path, 'by_name' => $item_array));
             } else {
-                return $this->archive->extract(array('add_path' => $target_path));
+                $result = $this->archive->extract(array('add_path' => $target_path));
+            }
+            // extract() returns an array on success and 0 on failure
+            if ($result === 0) {
+                return false;
+            } else {
+                return true;
             }
         
         }
@@ -470,4 +476,4 @@
     }
 
 }
-?>
\ No newline at end of file
+?>



More information about the geeklog-cvs mailing list