cellog          Thu Jun 11 14:39:37 2009 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/win32/build        Makefile mkdist.php 
  Log:
  add phar.phar creation on windows
  
http://cvs.php.net/viewvc.cgi/php-src/win32/build/Makefile?r1=1.35.2.1.2.6.2.12&r2=1.35.2.1.2.6.2.13&diff_format=u
Index: php-src/win32/build/Makefile
diff -u php-src/win32/build/Makefile:1.35.2.1.2.6.2.12 
php-src/win32/build/Makefile:1.35.2.1.2.6.2.13
--- php-src/win32/build/Makefile:1.35.2.1.2.6.2.12      Wed May 27 01:46:48 2009
+++ php-src/win32/build/Makefile        Thu Jun 11 14:39:37 2009
@@ -14,7 +14,7 @@
 #  | Author: Wez Furlong <w...@thebrainroom.com>                           |
 #  +----------------------------------------------------------------------+
 #
-# $Id: Makefile,v 1.35.2.1.2.6.2.12 2009/05/27 01:46:48 kalle Exp $
+# $Id: Makefile,v 1.35.2.1.2.6.2.13 2009/06/11 14:39:37 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.13.4.1.2.11&r2=1.13.4.1.2.12&diff_format=u
Index: php-src/win32/build/mkdist.php
diff -u php-src/win32/build/mkdist.php:1.13.4.1.2.11 
php-src/win32/build/mkdist.php:1.13.4.1.2.12
--- php-src/win32/build/mkdist.php:1.13.4.1.2.11        Wed Jun  3 01:14:58 2009
+++ php-src/win32/build/mkdist.php      Thu Jun 11 14:39:37 2009
@@ -1,4 +1,4 @@
-<?php # $Id: mkdist.php,v 1.13.4.1.2.11 2009/06/03 01:14:58 kalle Exp $
+<?php # $Id: mkdist.php,v 1.13.4.1.2.12 2009/06/11 14:39:37 cellog Exp $
 /* piece together a windows binary distro */
 
 $build_dir = $argv[1];
@@ -393,6 +393,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);
 }
@@ -489,4 +510,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