Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44225 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64850 invoked from network); 10 Jun 2009 16:44:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jun 2009 16:44:56 -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.200.174 cause and error) X-PHP-List-Original-Sender: greg@chiaraquartet.net X-Host-Fingerprint: 209.85.200.174 wf-out-1314.google.com Received: from [209.85.200.174] ([209.85.200.174:15772] helo=wf-out-1314.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F4/B8-50806-703EF2A4 for ; Wed, 10 Jun 2009 12:44:56 -0400 Received: by wf-out-1314.google.com with SMTP id 28so347923wfc.26 for ; Wed, 10 Jun 2009 09:44:53 -0700 (PDT) Received: by 10.141.71.14 with SMTP id y14mr5533723rvk.2.1244652293170; Wed, 10 Jun 2009 09:44:53 -0700 (PDT) Received: from monster.local ([76.84.30.125]) by mx.google.com with ESMTPS id c20sm114948rvf.0.2009.06.10.09.44.51 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 10 Jun 2009 09:44:52 -0700 (PDT) Message-ID: <4A2FE302.6010300@chiaraquartet.net> Date: Wed, 10 Jun 2009 11:44:50 -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> In-Reply-To: X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] doing phar.phar on windows From: greg@chiaraquartet.net (Greg Beaver) Pierre Joye wrote: > On Wed, Jun 10, 2009 at 5:36 PM, Greg Beaver wrote: > >> Hi, >> >> I don't see an obvious way to build the phar.phar on windows. >> >> Can someone with knowledge of how configure.js works (i.e. a Pierre) >> give me a tip on how to tell it to make phar.phar after building >> Release_TS/php.exe or Debug_TS/php.exe? >> >> Otherwise, it would also be easy to provide a simple script that builds >> the phar.phar, and have the snapshot builder run the script. >> >> Which way would be better? >> > > Can you create it from PHP/using a php script? > > If yes, we can add it to mkdist.php easily. Fantastic, in that case, all that needs to be added to mkdist.php is this: echo "Generating phar.phar\r\n"; $phar = new Phar($path_to_php . '/phar.phar', 0, 'pharcommand'); foreach (new DirectoryIterator($path_to_phar . '/phar') as $file) { if ($file->isDir() || $file == 'phar.php') continue; echo 'adding ', $file, "\r\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\r\n"; file_put_contents($path_to_php . '/phar.phar.bat', 'php phar.phar %1 %2 %3 %4 %5 %6 %7 %8 %9\r\n"); That should do it. The only problem is that the user will need to adjust the path of phar.phar at install-time, but I don't see any obvious way around this outside of the win32 installer. Note that $path_to_php should be the equivalent of C:\php5 and $path_to_phar should be C:\php5\ext\phar Greg