Skip to content

Commit

Permalink
Merge pull request #4887 from JediKev/cli/package-better-wording
Browse files Browse the repository at this point in the history
cli: Package Better Wording
  • Loading branch information
protich committed May 10, 2019
2 parents ba1fb38 + bf20bdd commit fac1c2d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/cli/modules/package.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ function packageZip($name, $path) {
if (!$zip->open($name, ZipArchive::CREATE | ZipArchive::OVERWRITE) === true)
return false;

$php56 = version_compare(phpversion(), '5.6.0', '>');
$addFiles = function($dir) use (&$addFiles, $zip, $path, $php56) {
$php56plus = version_compare(phpversion(), '5.6.0', '>');
$addFiles = function($dir) use (&$addFiles, $zip, $path, $php56plus) {
$files = array_diff(scandir($dir), array('.','..'));
$path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
foreach ($files as $file) {
Expand All @@ -122,7 +122,7 @@ function packageZip($name, $path) {
// out of OS open file handles
$zip->addFromString($local, file_get_contents($full));
// This only works on PHP >= v5.6
if ($php56) {
if ($php56plus) {
// Set the Unix mode of the file
$stat = stat($full);
$zip->setExternalAttributesName($local, ZipArchive::OPSYS_UNIX, $stat['mode'] << 16);
Expand Down

0 comments on commit fac1c2d

Please sign in to comment.