1 | <?php |
||
7 | class Zip |
||
8 | { |
||
9 | /** |
||
10 | * Downloads a theme and unzips it. |
||
11 | * |
||
12 | * @param string $url The URL to download the theme. |
||
13 | * @param string $directory The directory to download the theme to. |
||
14 | * @param string $name The theme directory name. |
||
15 | * |
||
16 | * @return string The path to the downloaded theme on success and an empty string on failure. . |
||
17 | */ |
||
18 | public static function execute($url, $directory, $name) |
||
30 | |||
31 | /** |
||
32 | * Rename the extracted zip file. |
||
33 | * |
||
34 | * @param string $extracted The extracted zip file location. |
||
35 | * @param string $directory The extracted zip file directory. |
||
36 | * @param string $name The name to rename the extracted zip file. |
||
37 | */ |
||
38 | protected static function rename($extracted, $directory, $name) |
||
44 | |||
45 | /** |
||
46 | * Deletes the downloaded zip. |
||
47 | * |
||
48 | * @param string $zip The path to the zip file. |
||
49 | */ |
||
50 | protected static function cleanUp($zip) |
||
56 | |||
57 | /** |
||
58 | * Extracts a zip file. |
||
59 | * |
||
60 | * @param string $zip The path to the zip file. |
||
61 | * @param string $directory The extraction directory. |
||
62 | */ |
||
63 | public static function extract($zip, $directory, $name) |
||
79 | } |
||
80 |