summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/libraries
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-01-07 14:28:17 +0100
committerAndrey Andreev <narf@devilix.net>2014-01-07 14:28:17 +0100
commit45082b6118a9b66e48c16582f72d4499d2c290c6 (patch)
tree89eaff0022bb7d93458beb11443ddd3222b0cc51 /user_guide_src/source/libraries
parent0c9d08056e0816a1103b5b13b9c8e297f430d7bb (diff)
[ci skip] Update CI_Zip::read_file() docs
Diffstat (limited to 'user_guide_src/source/libraries')
-rw-r--r--user_guide_src/source/libraries/zip.rst16
1 files changed, 13 insertions, 3 deletions
diff --git a/user_guide_src/source/libraries/zip.rst b/user_guide_src/source/libraries/zip.rst
index ea5b46bac..535aa82d9 100644
--- a/user_guide_src/source/libraries/zip.rst
+++ b/user_guide_src/source/libraries/zip.rst
@@ -98,10 +98,10 @@ Class Reference
$this->zip->add_dir('myfolder'); // Creates a directory called "myfolder"
- .. method:: read_file($path[, $preserve_filepath = FALSE])
+ .. method:: read_file($path[, $archive_filepath = FALSE])
- :param string $path: path to file
- :param bool $preserve_filepath: whether to maintain the original filepath
+ :param string $path: Path to file
+ :param mixed $archive_filepath: New file name/path (string) or (boolean) whether to maintain the original filepath
:returns: bool
Permits you to compress a file that already exists somewhere on your server.
@@ -126,6 +126,16 @@ Class Reference
In the above example, photo.jpg will be placed into the *path/to/* directory.
+ You can also specify a new name (path included) for the added file on the fly::
+
+ $path = '/path/to/photo.jpg';
+ $new_path = '/new/path/some_photo.jpg';
+
+ $this->zip->read_file($path, $new_path);
+
+ // Download ZIP archive containing /new/path/some_photo.jpg
+ $this->zip->download('my_archive.zip');
+
.. method:: read_dir($path[, $preserve_filepath = TRUE[, $root_path = NULL]])
:param string $path: path to directory