Skip to content
This repository has been archived by the owner on Jan 9, 2018. It is now read-only.

Commit

Permalink
Compress only big files
Browse files Browse the repository at this point in the history
  • Loading branch information
shoghicp committed Jan 14, 2015
1 parent 2dff574 commit 9325e89
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/DevTools/ConsoleScript.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,7 @@
}
echo "\r[".(++$count)."] ".str_pad($path, $maxLen, " ");
}
if(isset($opts["compress"])){
echo "\nCompressing...\n";
$phar->compressFiles(\Phar::GZ);
}

$phar->stopBuffering();

echo "Done!\n";
Expand Down
7 changes: 6 additions & 1 deletion src/DevTools/DevTools.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,12 @@ private function makePluginLoader(CommandSender $sender, Command $command, $labe
$phar->addFile($this->getFile() . "src/FolderPluginLoader/FolderPluginLoader.php", "src/FolderPluginLoader/FolderPluginLoader.php");
$phar->addFile($this->getFile() . "src/FolderPluginLoader/Main.php", "src/FolderPluginLoader/Main.php");

$phar->compressFiles(\Phar::GZ);
foreach($phar as $file => $finfo){
/** @var \PharFileInfo $finfo */
if($finfo->getSize() > (1024 * 512)){
$finfo->compress(\Phar::GZ);
}
}
$phar->stopBuffering();
$sender->sendMessage("Folder plugin loader has been created on ".$pharPath);
return true;
Expand Down

0 comments on commit 9325e89

Please sign in to comment.