mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Fix code sample
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@339282 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
65e6a11592
commit
244efca786
2 changed files with 2 additions and 2 deletions
|
@ -83,7 +83,7 @@ if ($zip->open('test.zip') === TRUE) {
|
|||
if ($zip->extractTo('.', $s['name'])) {
|
||||
if ($zip->getExternalAttributesIndex($idx, $opsys, $attr)
|
||||
&& $opsys==ZipArchive::OPSYS_UNIX) {
|
||||
chmod($s['name'], ($attr & 07777));
|
||||
chmod($s['name'], ($attr >> 16) & 0777);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ $zip = new ZipArchive();
|
|||
$stat = stat($filename='test.txt');
|
||||
if (is_array($stat) && $zip->open('test.zip', ZipArchive::CREATE) === TRUE) {
|
||||
$zip->addFile($filename);
|
||||
$zip->setExternalAttributesName($filename, ZipArchive::OPSYS_UNIX, $stat['mode']);
|
||||
$zip->setExternalAttributesName($filename, ZipArchive::OPSYS_UNIX, $stat['mode'] << 16);
|
||||
$zip->close();
|
||||
echo "Ok\n";
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue