Created
September 10, 2019 15:29
-
-
Save uzulla/2c48eb52a8de20040e04206148fe73f5 to your computer and use it in GitHub Desktop.
uploadしてあるzipをサーバーで解凍
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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