I have a zip folder that I want to place into the root of my application. The zip folder and contents looks like this;
documents.zip
- docs/
- index.html
- test.txt
Using the following code;
$zip = new ZipArchive;
$zip->open( $package, ZIPARCHIVE::CREATE );
$zip->extractTo( ROOTPATH );
The zip folder is unzipped and ends up looking like this;
- docs/
- index.html
- test.txt
However I'd like to place the contents of the docs
folder in the actual environment root. ROOTPATH
(the env root, from above) evaluates to app/public/
so the zip folder contents is currently unzipped to app/public/docs/
.
How can I move the contents with ZipArchive into the root?