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

Commit

Permalink
Improved compression
Browse files Browse the repository at this point in the history
  • Loading branch information
shoghicp committed Jan 14, 2015
1 parent 9325e89 commit 902ce88
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: DevTools
main: DevTools\DevTools
version: 1.9.0
version: 1.10.0
api: 1.3.1
load: STARTUP
author: PocketMine Team
Expand Down
13 changes: 12 additions & 1 deletion src/DevTools/DevTools.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,12 @@ private function makePluginCommand(CommandSender $sender, Command $command, $lab
$sender->sendMessage("[DevTools] Adding $path");
}

$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("Phar plugin ".$description->getName() ." v".$description->getVersion()." has been created on ".$pharPath);
return true;
Expand Down Expand Up @@ -226,6 +231,12 @@ private function makeServerCommand(CommandSender $sender, Command $command, $lab
$phar->addFile($file, $path);
$sender->sendMessage("[DevTools] Adding $path");
}
foreach($phar as $file => $finfo){
/** @var \PharFileInfo $finfo */
if($finfo->getSize() > (1024 * 512)){
$finfo->compress(\Phar::GZ);
}
}
$phar->stopBuffering();

$sender->sendMessage($server->getName() . " " . $server->getPocketMineVersion() . " Phar file has been created on ".$pharPath);
Expand Down

0 comments on commit 902ce88

Please sign in to comment.