Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38546 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9428 invoked from network); 23 Jun 2008 16:05:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jun 2008 16:05:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=steph@phparch.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=steph@phparch.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain phparch.com from 64.99.136.187 cause and error) X-PHP-List-Original-Sender: steph@phparch.com X-Host-Fingerprint: 64.99.136.187 smtprelay-virgin0187.hostedemail.com Linux 2.5 (sometimes 2.4) (4) Received: from [64.99.136.187] ([64.99.136.187:50141] helo=smtprelay-virgin.hostedemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0D/31-03212-3D9CF584 for ; Mon, 23 Jun 2008 12:05:39 -0400 Received: from smtprelay-virgin.hostedemail.com (ff-bigip1 [10.5.19.254]) by smtpgrave04.hostedemail.com (Postfix) with ESMTP id 7BB7C281B49 for ; Mon, 23 Jun 2008 15:44:07 +0000 (UTC) Received: from filter.hostedemail.com (ff-bigip1 [10.5.19.254]) by smtprelay04.hostedemail.com (Postfix) with SMTP id 253751BC7CE; Mon, 23 Jun 2008 15:43:15 +0000 (UTC) X-SpamScore: 1 Received: from foxbox (host86-143-244-1.range86-143.btcentralplus.com [86.143.244.1]) (Authenticated sender: steph.fox) by omf13.hostedemail.com (Postfix) with ESMTP; Mon, 23 Jun 2008 15:43:14 +0000 (UTC) Message-ID: <01b401c8d548$0c0e1430$4401a8c0@foxbox> Reply-To: "Steph Fox" To: "Pierre Joye" Cc: "Greg Beaver" , "Marcus Boerger" , "internals" References: <028a01c8d4a7$18dd4380$4401a8c0@foxbox> <008601c8d524$41184e30$4401a8c0@foxbox> <017401c8d53e$de2a9380$4401a8c0@foxbox> Date: Mon, 23 Jun 2008 16:44:37 +0100 Organization: php|architect MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-session-marker: 73746570682E666F78 X-Spam-Summary: 50,0,0,0b3b5d4ac7f82314,db91dfb2344a6b94,steph@phparch.com,,RULES_HIT:355:379:539:540:541:542:543:567:599:601:945:960:967:973:988:989:1155:1156:1260:1277:1311:1313:1314:1345:1437:1515:1516:1518:1534:1543:1587:1593:1594:1605:1711:1730:1747:1766:1792:2073:2075:2078:2110:2378:2393:2525:2553:2561:2564:2682:2685:2692:2693:2828:2857:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3027:3770:3865:3866:3867:3868:3869:3870:3871:3872:3873:3874:3934:3936:3938:3941:3944:3947:3950:4250:4470:5007:6119:6261:7679:7875:7903,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:none,DNSBL:none Subject: Re: [PHP-DEV] OpenSSL and Phar From: steph@phparch.com ("Steph Fox") Pierre, > I finally took a look at why phar is not built shared as all other > extension. It seems to force it only to be able to be run with no dep > but still uses them if they are lately added (given that phar is now > built statically, that makes little sense). But in fact, it does have > deps against ext/zlib, ext/bz2 and now ext/openssl. It has *optional* dependencies on all three, yes. Not hard dependencies. Phar works fine without them, it's just you can't have bz2 compression without bz2 etc. > You may want to use the library directly but as it will be easy and > problemless for bz2 and zlib, it is going to be a pain for openssl. Ah, now you understand the problem. The thing is that direct use equates to "phar needs libeay32.dll". (Not the other one in my shared-build tests, not sure why.) Now, as you pointed out earlier, libeay32.dll is bundled with the Windows distro, so in itself that isn't a problem - people won't struggle to find it. But if phar's built-in, that gives PHP a hard third-party dependency by default, which is obviously not acceptable. The way Greg's written it allows for the openssl extension to be a soft dependency. If it's not loaded, you just miss that part of Phar's functionality, and if you want the functionality you need to load php_openssl.dll. However, if you happen to have built openssl statically into PHP, you might as well use the underlying library directly, and currently under Linux that's exactly what happens. That's fine, but it's also a little odd, since it means the only time you don't use ext/openssl is when it's there Now let's talk about use cases. The way OpenSSL is used in phar is very minor - just OpenSSL signature verification and creation from existing private keys. If you want to do any more than that you'd need to load php_openssl.dll anyway. But most people probably won't want to do any more than that. Also, if you want to run ext/openssl under Windows you need to set it up a working environment for it, and this isn't necessary if you just want to support OpenSSL signatures in ext/phar. So I think we need to offer the *option* of having a hard dependency on libeay32.dll, with the default being no dependency. In the config.w32 I posted earlier, the assumption is that anyone building --with-openssl won't find that hard dependency a problem, but I'm not sure this is a good idea, especially given that there's a perfectly good fallback solution. The other thing we could do of course is throw out all that pure library code and only offer OpenSSL signature support when ext/openssl is loaded. That has the benefit of clarity at least. > My main question now is why don't you actually reflect the (optional) > dependencies? bz2 and zlib compression available will not be available > if bz2 or zlib is not present, same for openssl. What do you mean? In config.w32? No need. In phpinfo()? We already do, just haven't added the openssl part yet because the configuration's up in the air. > As testing has_xxx at runtime looks shiny and powerful, I don't think > it is worth the pain. Sorry, I failed to parse that sentence... :\ Cheers, - Steph > > Cheers, > -- > Pierre > > http://blog.thepimp.net | http://www.libgd.org