1 | <?php |
||
10 | class HackedProjectWebDownloader |
||
11 | { |
||
12 | /** |
||
13 | * @var Project |
||
14 | */ |
||
15 | protected $project; |
||
16 | |||
17 | /** |
||
18 | * Constructor, pass in the project this downloaded is expected to download. |
||
19 | * @param Project $project |
||
20 | */ |
||
21 | public function __construct(Project $project) |
||
25 | |||
26 | /** |
||
27 | * Returns a temp directory to work in. |
||
28 | * |
||
29 | * @param string $namespace |
||
30 | * The optional namespace of the temp directory, defaults to the classname. |
||
31 | * @return string |
||
32 | */ |
||
33 | protected function getTempDirectory($namespace = null) |
||
52 | |||
53 | /** |
||
54 | * Returns a directory to save the downloaded project into. |
||
55 | * @return string |
||
56 | */ |
||
57 | protected function getDestination() |
||
72 | |||
73 | /** |
||
74 | * Returns the final destination of the unpacked project. |
||
75 | * @return string |
||
76 | */ |
||
77 | public function getFinalDestination() |
||
83 | |||
84 | /** |
||
85 | * Download the remote files to the local filesystem. |
||
86 | * @return bool |
||
87 | */ |
||
88 | public function downloadFile() |
||
92 | |||
93 | /** |
||
94 | * Recursively delete all files and folders in the specified filepath, then |
||
95 | * delete the containing folder. |
||
96 | * |
||
97 | * Note that this only deletes visible files with write permission. |
||
98 | * |
||
99 | * @param string $path |
||
100 | * A filepath relative to file_directory_path. |
||
101 | */ |
||
102 | protected function removeDir($path) |
||
121 | } |
||
122 |