1 | <?php |
||
13 | class ZipHelper |
||
14 | { |
||
15 | /** |
||
16 | * Add files and sub-directories in a folder to zip file. |
||
17 | * |
||
18 | * @param string $folder |
||
19 | * @param \ZipArchive $zipFile |
||
20 | * @param integer $exclusiveLength Number of text to be exclusived from the file path. |
||
21 | */ |
||
22 | private static function folderToZip($folder, &$zipFile, $exclusiveLength) |
||
41 | |||
42 | /** |
||
43 | * Zip a folder (include itself). |
||
44 | * |
||
45 | * ```php |
||
46 | * \luya\helper\Zip::zipDir('/path/to/sourceDir', '/path/to/out.zip'); |
||
47 | * ``` |
||
48 | * |
||
49 | * @param string $sourcePath Path of directory to be zip. |
||
50 | * @param string $outZipPath Path of output zip file. |
||
51 | */ |
||
52 | public static function dir($sourcePath, $outZipPath) |
||
66 | } |
||
67 |