Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

making the make_phar.php script a little friendlier

  • Loading branch information...
commit 2cf0fae34ad953110c7d42398c86779aec5a91c2 1 parent 1a00a19
Jonthan Moss authored
Showing with 11 additions and 2 deletions.
  1. +11 −2 make_phar.php
View
13 make_phar.php
@@ -1,4 +1,10 @@
<?php
+
+if (ini_get('phar.readonly')) {
+ echo "You must set the php.ini option 'phar.readonly = 0' to enable phar creation";
+ die();
+}
+
$filename = 'Morph.phar';
$base_dir = dirname(__FILE__);
$src_dir = $base_dir . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'morph' . DIRECTORY_SEPARATOR;
@@ -11,11 +17,14 @@
);
if (file_exists($filename)) {
+ echo "Deleteing the old phar file\n";
unlink($filename);
}
+echo "Creating phar file...\n";
$phar = new Phar($filename, 0, 'Morph');
-
$phar->buildFromDirectory($src_dir);
$phar->setStub(file_get_contents($src_dir . '..' . DIRECTORY_SEPARATOR . 'bootstrap.php'));
-$phar->setMetadata($metadata);
+$phar->setMetadata($metadata);
+$phar->compressFiles(Phar::GZ);
+echo "All done!";
Please sign in to comment.
Something went wrong with that request. Please try again.