From 45082b6118a9b66e48c16582f72d4499d2c290c6 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 7 Jan 2014 15:28:17 +0200 Subject: [ci skip] Update CI_Zip::read_file() docs --- user_guide_src/source/libraries/zip.rst | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'user_guide_src/source/libraries/zip.rst') 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 -- cgit v1.2.3-24-g4f1b