Skip to content

Commit 3df8737

Browse files
committed
Merge pull request #134 from dpauli/enhancement/compress-archive-file-#115
Compress phar file. #115
2 parents b906423 + 940dcff commit 3df8737

File tree

2 files changed

+36
-6
lines changed

2 files changed

+36
-6
lines changed

build/make.php

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,51 @@
2323
}
2424
else {
2525
echo "<ul>";
26-
echo "<li><strong>Creating the .phar</strong></li>";
27-
$phar = new Phar($filename);
26+
echo "<li><strong>Creating the temp.phar</strong></li>";
27+
$phar = new Phar("temp.phar");
2828

2929
echo "<li><strong>Adding all files</strong></li>";
3030
$phar->buildFromDirectory('../src');
3131

3232
echo "<li><strong>Create and set default stub</strong></li>";
3333
$phar->setStub($phar->createDefaultStub('Shop.class.php'));
3434

35-
echo "<li><strong>Delete the latest file</strong></li>";
35+
echo "<li><strong>Compress to temp.gz</strong></li>";
36+
$phar->compress(Phar::GZ);
37+
38+
echo "<li><strong>Compress to temp.bz2</strong></li>";
39+
$phar->compress(Phar::BZ2);
40+
41+
echo "<li><strong>Copy 'temp.phar' to 'epages-rest-php-" . $FRAMEWORK_VERSION . ".phar'</strong></li>";
42+
copy("temp.phar", $filename);
43+
44+
echo "<li><strong>Delete the 'temp.phar' file</strong></li>";
45+
unlink("temp.phar");
46+
47+
echo "<li><strong>Copy 'temp.phar.gz' to 'epages-rest-php-" . $FRAMEWORK_VERSION . ".phar.gz'</strong></li>";
48+
copy("temp.phar.gz", $filename . ".gz");
49+
50+
echo "<li><strong>Delete the 'temp.phar.gz' file</strong></li>";
51+
unlink("temp.phar.gz");
52+
53+
echo "<li><strong>Copy 'temp.phar.bz2' to 'epages-rest-php-" . $FRAMEWORK_VERSION . ".phar.bz2'</strong></li>";
54+
copy("temp.phar.bz2", $filename . ".bz2");
55+
56+
echo "<li><strong>Delete the 'temp.phar.bz2' file</strong></li>";
57+
unlink("temp.phar.bz2");
58+
59+
echo "<li><strong>Delete the latest 'epages-rest-php.phar' file</strong></li>";
3660
unlink($latestFilename);
3761

38-
echo "<li><strong>Copy to latest</strong></li>";
62+
echo "<li><strong>Copy 'epages-rest-php-" . $FRAMEWORK_VERSION . ".phar' to 'epages-rest-php.phar</strong></li>";
3963
copy($filename, $latestFilename);
4064

65+
echo "<li><strong>Copy 'epages-rest-php-" . $FRAMEWORK_VERSION . ".phar.gz' to 'epages-rest-php.phar.gz</strong></li>";
66+
copy($filename . ".gz", $latestFilename . ".gz");
67+
68+
echo "<li><strong>Copy 'epages-rest-php-" . $FRAMEWORK_VERSION . ".phar.bz2' to 'epages-rest-php.phar.bz2</strong></li>";
69+
copy($filename . ".bz2", $latestFilename . ".bz2");
70+
4171
echo "</ul>";
4272
}
4373
?>

src/configuration/config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
*
55
* @ignore
66
*/
7-
$FRAMEWORK_VERSION = "0.1.1"; // The version of this Framework.
8-
$BUILD_SCRIPT_VERSION = "0.0.1"; // The version of the build script.
7+
$FRAMEWORK_VERSION = "0.1.2"; // The version of this Framework.
8+
$BUILD_SCRIPT_VERSION = "0.0.2"; // The version of the build script.
99
?>

0 commit comments

Comments
 (0)