Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44234 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15576 invoked from network); 11 Jun 2009 04:42:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jun 2009 04:42:25 -0000 Authentication-Results: pb1.pair.com smtp.mail=greg@chiaraquartet.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=greg@chiaraquartet.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain chiaraquartet.net from 209.85.216.176 cause and error) X-PHP-List-Original-Sender: greg@chiaraquartet.net X-Host-Fingerprint: 209.85.216.176 mail-px0-f176.google.com Received: from [209.85.216.176] ([209.85.216.176:63657] helo=mail-px0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/90-12056-03B803A4 for ; Thu, 11 Jun 2009 00:42:24 -0400 Received: by pxi6 with SMTP id 6so1323672pxi.29 for ; Wed, 10 Jun 2009 21:42:21 -0700 (PDT) Received: by 10.142.156.2 with SMTP id d2mr845722wfe.64.1244695341402; Wed, 10 Jun 2009 21:42:21 -0700 (PDT) Received: from monster.local ([76.84.30.125]) by mx.google.com with ESMTPS id 32sm81253wfc.14.2009.06.10.21.42.19 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 10 Jun 2009 21:42:20 -0700 (PDT) Message-ID: <4A308B2A.8080906@chiaraquartet.net> Date: Wed, 10 Jun 2009 23:42:18 -0500 User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070807) MIME-Version: 1.0 To: Pierre Joye CC: PHP Developers Mailing List References: <4A2FD2F5.6010605@chiaraquartet.net> <4A2FE302.6010300@chiaraquartet.net> In-Reply-To: X-Enigmail-Version: 0.95.7 Content-Type: multipart/mixed; boundary="------------020908090006030509090106" Subject: [PATCH] Re: [PHP-DEV] doing phar.phar on windows From: greg@chiaraquartet.net (Greg Beaver) --------------020908090006030509090106 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I suppose it would help to see the patch, no? --------------020908090006030509090106 Content-Type: text/plain; name="phar.phar.patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="phar.phar.patch.txt" Index: win32/build/Makefile =================================================================== RCS file: /repository/php-src/win32/build/Makefile,v retrieving revision 1.35.2.1.2.6.2.12 diff -u -r1.35.2.1.2.6.2.12 Makefile --- win32/build/Makefile 27 May 2009 01:46:48 -0000 1.35.2.1.2.6.2.12 +++ win32/build/Makefile 11 Jun 2009 04:17:08 -0000 @@ -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 ..\.. Index: win32/build/mkdist.php =================================================================== RCS file: /repository/php-src/win32/build/mkdist.php,v retrieving revision 1.13.4.1.2.11 diff -u -r1.13.4.1.2.11 mkdist.php --- win32/build/mkdist.php 3 Jun 2009 01:14:58 -0000 1.13.4.1.2.11 +++ win32/build/mkdist.php 11 Jun 2009 04:31:54 -0000 @@ -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); ?> --------------020908090006030509090106--