Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44226 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72960 invoked from network); 10 Jun 2009 16:58:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jun 2009 16:58:49 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 72.14.220.153 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 72.14.220.153 fg-out-1718.google.com Received: from [72.14.220.153] ([72.14.220.153:64691] helo=fg-out-1718.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3B/7A-50806-846EF2A4 for ; Wed, 10 Jun 2009 12:58:48 -0400 Received: by fg-out-1718.google.com with SMTP id 16so271088fgg.0 for ; Wed, 10 Jun 2009 09:58:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=ezm3Cmk1ZjK6RTdw22x9uRvhv/FCt2ahkDuWa1/xopc=; b=Ivh/HwF4Pj3wnnqC9idur+8JcKeGZWTyMf4fB59KVVaxOGj+Qvj4hs2VPEn0l5YaJV UEI1s7hGDW9Vjojt5X4qKywOhYHGldEpLSlBkPViwetksr/1HdZxD2SdffILeqoIe+Co QRZ1AdTnA3TrNgOhJPxryqTg7pTnsZVLbFsdA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=ozHGTRPusBw9OustJcAb9gIeV9Uod0cYcsnjUIcmM2D0XdPxlj414en7aAAjtyjR/g oX7Ge27UOeiw7TEoW44znFN3LAV5rDg5z/Yk+nlLW0VSP4tkVX4dgXKVeYQSzzllNy6H BO3p/ttUoYDLD9Oi9gDaLThPsXJsLyGZueT0o= MIME-Version: 1.0 Received: by 10.86.68.1 with SMTP id q1mr1287634fga.10.1244653124915; Wed, 10 Jun 2009 09:58:44 -0700 (PDT) In-Reply-To: <4A2FE302.6010300@chiaraquartet.net> References: <4A2FD2F5.6010605@chiaraquartet.net> <4A2FE302.6010300@chiaraquartet.net> Date: Wed, 10 Jun 2009 18:58:44 +0200 Message-ID: To: Greg Beaver Cc: PHP Developers Mailing List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] doing phar.phar on windows From: pierre.php@gmail.com (Pierre Joye) On Wed, Jun 10, 2009 at 6:44 PM, Greg Beaver wrote: > Pierre Joye wrote: >> On Wed, Jun 10, 2009 at 5:36 PM, Greg Beaver wro= te: >> >>> 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 =3D new Phar($path_to_php . '/phar.phar', 0, 'pharcommand'); > foreach (new DirectoryIterator($path_to_phar . '/phar') as $file) { > =A0 =A0if ($file->isDir() || $file =3D=3D 'phar.php') continue; > =A0 =A0echo 'adding ', $file, "\r\n"; > =A0 =A0$phar[(string) $file] =3D file_get_contents($path_to_phar. =A0'/ph= ar/' . > $file); > } > $phar->setSignatureAlgorithm(Phar::SHA1); > $stub =3D 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. =A0The 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 We don't know these paths when on unzip the releases in some random directories. Maybe that should be something to add in the installer instead? But reading this little script, why don't you detect magically where phar.bat is in phar.bat and then call phar.phar from there? It is possible to do that in batch files (see http://cvs.php.net/viewvc.cgi/php-internals-win/script/ there are some dirty examples there). Cheers, --=20 Pierre http://blog.thepimp.net | http://www.libgd.org