summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2010-05-11 15:58:21 +0200
committerDerek Jones <derek.jones@ellislab.com>2010-05-11 15:58:21 +0200
commit2735b3eeb3403ba813aac56ed6f10be536839ff6 (patch)
treec8776c6e1d89da080aefabfbc4e928b6d8ba21db
parent26872de184e4aa2ae92bae645782089e9656115d (diff)
fixed whitespace, massaged Zip read_dir() docs
-rw-r--r--system/libraries/Zip.php4
-rw-r--r--user_guide/libraries/zip.html4
2 files changed, 4 insertions, 4 deletions
diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php
index 3ba3ddc83..92dfc814d 100644
--- a/system/libraries/Zip.php
+++ b/system/libraries/Zip.php
@@ -273,7 +273,7 @@ class CI_Zip {
*/
function read_dir($path, $preserve_filepath = TRUE, $root_path = NULL)
{
- if (!$fp = @opendir($path))
+ if ( ! $fp = @opendir($path))
{
return FALSE;
}
@@ -295,7 +295,6 @@ class CI_Zip {
{
$this->read_dir($path.$file."/", $preserve_filepath, $root_path);
}
-
else
{
if (FALSE !== ($data = file_get_contents($path.$file)))
@@ -311,6 +310,7 @@ class CI_Zip {
}
}
}
+
return TRUE;
}
diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html
index 844023b9e..d57dd48ac 100644
--- a/user_guide/libraries/zip.html
+++ b/user_guide/libraries/zip.html
@@ -189,7 +189,7 @@ $this->zip->read_dir($path);
$this->zip->download('my_backup.zip');
</code>
-<p>By default the Zip archive will place all directories listed in the first parameter inside the zip. If you only want the end folder to be in the zip
+<p>By default the Zip archive will place all directories listed in the first parameter inside the zip. If you want the tree preceding the target folder to be ignored
you can pass <kbd>FALSE</kbd> (boolean) in the second parameter. Example:</p>
<code>
@@ -197,7 +197,7 @@ $path = '/path/to/your/directory/';<br /><br />
$this->zip->read_dir($path, FALSE);
</code>
-<p>This will create a ZIP with the folder "directory" inside, then all sub-folders stored correctly inside that.</p>
+<p>This will create a ZIP with the folder "directory" inside, then all sub-folders stored correctly inside that, but will not include the folders <samp>/path/to/your</samp>.</p>