Commits

Derek Jones committed e7b9282

fixed whitespace, massaged Zip read_dir() docs

Comments (0)

Files changed (2)

system/libraries/Zip.php

 	 */
 	function read_dir($path, $preserve_filepath = TRUE, $root_path = NULL)
 	{
-		if (!$fp = @opendir($path))
+		if ( ! $fp = @opendir($path))
 		{
 			return FALSE;
 		}
 			{
 				$this->read_dir($path.$file."/", $preserve_filepath, $root_path);
 			}
-
 			else
 			{
 				if (FALSE !== ($data = file_get_contents($path.$file)))
 				}
 			}
 		}
+
 		return TRUE;
 	}
 

user_guide/libraries/zip.html

 $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>
 $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>