diff --git a/dist/public/unzip.php b/dist/public/unzip.php new file mode 100644 index 0000000..be0ec7d --- /dev/null +++ b/dist/public/unzip.php @@ -0,0 +1,62 @@ +"; +// rrmdir($dest2); + +// print "Extracting archive...
"; + +// $zip = new ZipArchive; +// Zip File Name +// if ($zip->open($source2) === TRUE) { + // Unzip Path +// $zip->extractTo($dest2); +// $zip->close(); +// print 'Unzipped Process Successful!
'; +// } else { +// print 'Unzipped Process failed
'; +// } + +// Delete existing directory +print "Removing existing directory...
"; +rrmdir($dest); + +print "Extracting archive...
"; + +$zip = new ZipArchive; +// Zip File Name +if ($zip->open($source) === TRUE) { + // Unzip Path + $zip->extractTo($dest); + $zip->close(); + print 'Unzipped Process Successful!
'; +} else { + print 'Unzipped Process failed
'; +} + +$endtime = microtime(true); +print "Executing this script took ".$endtime-$starttime." seconds!"; + +function rrmdir($dir) { + if (is_dir($dir)) { + $objects = scandir($dir); + foreach ($objects as $object) { + if ($object != "." && $object != "..") { + if (filetype($dir."/".$object) == "dir") + rrmdir($dir."/".$object); + else unlink ($dir."/".$object); + } + } + reset($objects); + rmdir($dir); + print $dir."
"; + } +}