Skip to content
Snippets Groups Projects
Unverified Commit fac1c2db authored by Peter Rotich's avatar Peter Rotich Committed by GitHub
Browse files

Merge pull request #4887 from JediKev/cli/package-better-wording

cli: Package Better Wording
parents ba1fb383 bf20bdd5
No related branches found
No related tags found
No related merge requests found
......@@ -108,8 +108,8 @@ class Packager extends Deployment {
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) {
......@@ -122,7 +122,7 @@ class Packager extends Deployment {
// 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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment