Skip to content

Instantly share code, notes, and snippets.

@uzulla
Created September 10, 2019 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uzulla/2c48eb52a8de20040e04206148fe73f5 to your computer and use it in GitHub Desktop.
Save uzulla/2c48eb52a8de20040e04206148fe73f5 to your computer and use it in GitHub Desktop.
uploadしてあるzipをサーバーで解凍
<?php
# uploadしてあるzipをサーバーで解凍
# FTPが重いレンサバなどで、`unzip source.zip`が使えない場合などに使う
# ext-zipが必要
ini_set("max_execution_time", 300);
$zip = new \ZipArchive;
if ($zip->open('source.zip') === true){
$zip->extractTo(__DIR__.'/');
$zip->close();
echo 'success';
} else {
echo 'failed';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment