cellog          Thu Jun 11 14:43:03 2009 UTC

  Modified files:              
    /php-src/win32/build        Makefile mkdist.php 
  Log:
  MFB: add phar.phar generation to windows
  
http://cvs.php.net/viewvc.cgi/php-src/win32/build/Makefile?r1=1.54&r2=1.55&diff_format=u
Index: php-src/win32/build/Makefile
diff -u php-src/win32/build/Makefile:1.54 php-src/win32/build/Makefile:1.55
--- php-src/win32/build/Makefile:1.54   Wed May 27 01:46:27 2009
+++ php-src/win32/build/Makefile        Thu Jun 11 14:43:03 2009
@@ -14,7 +14,7 @@
 #  | Author: Wez Furlong <w...@thebrainroom.com>                           |
 #  +----------------------------------------------------------------------+
 #
-# $Id: Makefile,v 1.54 2009/05/27 01:46:27 kalle Exp $
+# $Id: Makefile,v 1.55 2009/06/11 14:43:03 cellog Exp $
 # This is the makefile template for the win32 build
 
 CC="$(CL)"
@@ -128,7 +128,7 @@
        -del /f /q 
$(BUILD_DIR)\php-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip
        -del /f /q 
$(BUILD_DIR)\php-debug-pack-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip
        -del /f /q 
$(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip
-       $(BUILD_DIR)\php.exe -d date.timezone=UTC -n win32/build/mkdist.php 
"$(BUILD_DIR)" "$(PHPDLL)" "$(SAPI_TARGETS)" "$(EXT_TARGETS) 
$(PHP_EXTRA_DIST_FILES)" "$(PECL_TARGETS) $(PECL_EXTRA_DIST_FILES)" 
"$(SNAPSHOT_TEMPLATE)"
+       $(BUILD_DIR)\php.exe -d date.timezone=UTC -n -dphar.readonly=0 
win32/build/mkdist.php "$(BUILD_DIR)" "$(PHPDLL)" "$(SAPI_TARGETS)" 
"$(EXT_TARGETS) $(PHP_EXTRA_DIST_FILES)" "$(PECL_TARGETS) 
$(PECL_EXTRA_DIST_FILES)" "$(SNAPSHOT_TEMPLATE)"
        cd $(BUILD_DIR)\php-$(PHP_VERSION_STRING)
        -$(ZIP) -9 -q -r 
..\php-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip
 .
        cd ..\..
http://cvs.php.net/viewvc.cgi/php-src/win32/build/mkdist.php?r1=1.24&r2=1.25&diff_format=u
Index: php-src/win32/build/mkdist.php
diff -u php-src/win32/build/mkdist.php:1.24 php-src/win32/build/mkdist.php:1.25
--- php-src/win32/build/mkdist.php:1.24 Wed Jun  3 01:13:37 2009
+++ php-src/win32/build/mkdist.php      Thu Jun 11 14:43:03 2009
@@ -1,4 +1,4 @@
-<?php # $Id: mkdist.php,v 1.24 2009/06/03 01:13:37 kalle Exp $
+<?php # $Id: mkdist.php,v 1.25 2009/06/11 14:43:03 cellog Exp $
 /* piece together a windows binary distro */
 
 $build_dir = $argv[1];
@@ -394,6 +394,27 @@
        closedir($directory_list); 
 }
 
+function make_phar_dot_phar($dist_dir)
+{
+  if (!extension_loaded('phar')) return;
+  $path_to_php = $dist_dir;
+  $path_to_phar = realpath(__DIR__ . '/../../ext/phar');
+  echo "Generating pharcommand.phar\n";
+  $phar = new Phar($path_to_php . '/pharcommand.phar', 0, 'pharcommand');
+  foreach (new DirectoryIterator($path_to_phar . '/phar') as $file) {
+    if ($file->isDir() || $file == 'phar.php') continue;
+    echo 'adding ', $file, "\n";
+    $phar[(string) $file] = file_get_contents($path_to_phar.  '/phar/' . 
$file);
+  }
+  $phar->setSignatureAlgorithm(Phar::SHA1);
+  $stub = file($path_to_phar . '/phar/phar.php');
+  unset($stub[0]); // remove hashbang
+  $phar->setStub(implode('', $stub));
+
+  echo "Creating phar.phar.bat\n";
+  file_put_contents($path_to_php . '/phar.phar.bat', "%~dp0php.exe 
%~dp0pharcommand.phar %1 %2 %3 %4 %5 %6 %7 %8 %9\r\n");
+}
+
 if (!is_dir($test_dir)) {
        mkdir($test_dir);
 }
@@ -491,4 +512,5 @@
        echo "WARNING: you don't have a snapshot template, your dist will not 
be complete\n";
 }
 
+make_phar_dot_phar($dist_dir);
 ?>



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to