Created
February 12, 2016 05:14
-
-
Save luissquall/c4305e167fd8643a8443 to your computer and use it in GitHub Desktop.
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 | |
/* | |
echo Tiago > monos | |
zip --password 1234 monos.zip monos | |
#unzip -P 1234 monos.zip -d unzipped | |
chgrp www . | |
chmod g+w . | |
*/ | |
$bin = shell_exec('which unzip'); | |
if ($bin) { | |
$bin = trim($bin); | |
$cwd = __DIR__; | |
$password = '1234'; | |
$file = $cwd . '/monos.zip'; | |
$dir = $cwd . '/unzipped'; | |
$cmd = "$bin -P 1234 $file -d $dir"; | |
exec($cmd, $output, $status); | |
// print_r($cmd); | |
// var_dump($output); | |
if ($status === 0) { | |
echo "Content unzipped"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment