Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56649 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11890 invoked from network); 28 Nov 2011 14:18:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Nov 2011 14:18:45 -0000 Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.170 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.216.170 mail-qy0-f170.google.com Received: from [209.85.216.170] ([209.85.216.170:50465] helo=mail-qy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 65/73-21284-34893DE4 for ; Mon, 28 Nov 2011 09:18:43 -0500 Received: by qyk33 with SMTP id 33so3447213qyk.29 for ; Mon, 28 Nov 2011 06:18:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ZE4MFbapA7CCiSJTpRYaNtCglKJeRIv18Dt91DEddzk=; b=ua/wIumrbPviYdYAJTPv8URxIDDnjmulXnEqRGof812kMPX47HFID0+jw0NIDjfAmg E60Mqg/p57ja7pPzEbUw7e28ySIsVFPv/gNZSR+1l1Z8+cll6i838Srma0xM5JPJCM73 3Wd2bHYTGXlTLy0GL2C/m2z5zmaknReXt2ZW4= MIME-Version: 1.0 Received: by 10.229.65.90 with SMTP id h26mr5184296qci.57.1322489921008; Mon, 28 Nov 2011 06:18:41 -0800 (PST) Received: by 10.229.38.134 with HTTP; Mon, 28 Nov 2011 06:18:40 -0800 (PST) In-Reply-To: References: Date: Mon, 28 Nov 2011 15:18:40 +0100 Message-ID: To: Derick Rethans Cc: Richard Quadling , PHP Developers Mailing List Content-Type: multipart/alternative; boundary=0016e64082dcf5f5bd04b2cc2d77 Subject: Re: [PHP-DEV] run-tests.php and dynamic extension dependencies From: tyra3l@gmail.com (Ferenc Kovacs) --0016e64082dcf5f5bd04b2cc2d77 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Nov 28, 2011 at 2:44 PM, Derick Rethans wrote: > On Mon, 28 Nov 2011, Richard Quadling wrote: > > > On 28 November 2011 13:36, Derick Rethans wrote: > > > On Mon, 28 Nov 2011, Ferenc Kovacs wrote: > > > > > >> On Mon, Nov 28, 2011 at 2:11 PM, Derick Rethans > wrote: > > >> > > >> > I'm currently writing a shared extension thta depends on another > > >> > shared extension (igbinary). "make test" doesn't handle this at th= e > > >> > moment, because it removes every extension=3D line from it's tempo= rary > > >> > php.ini. This means that the dependent extension (igbinary) now > > >> > isn't loaded, which means my extension doesn't load either and > > >> > obviously all the tests fail. > > >> > > > >> > I've attached a patch that adds a new --EXTENSIONS-- section to th= e > > >> > PHPT format. The run-tests.php script makes sure that all extensio= ns > > >> > in that last are added to the PHP command with -dextension=3D... ,= but > > >> > only if they're not build in (or already loaded in some other way)= . > > >> > > > >> > The patch is simple, and it doesn't touch any other section or > > >> > functionality so I'm suggesting to commit it to PHP 5.3/5.4 and > > >> > trunk some time soon. > > >> > > >> wouldn't --INI-- + extension do the same? > > > > > > No, as the run-tests.php framework changes "extension_dir" to > > > "./modules/". It would also cause issues if you try to load an > extension > > > that is built-in. And it's not portable because not on every platform > > > the extension name =3D extension.so > > > > Can you use PHP_SHLIB_SUFFIX? > > I am using that in my patch, but obviously that doesn't work with > extension=3D on the command line, which is how run-tests.php passes in > arguments from --INI--. > > derick@whisky:~$ php -dextension=3Digbinary.PHP_SHLIB_SUFFIX > PHP Warning: PHP Startup: Unable to load dynamic library > '/usr/local/php/5.3dev/lib/php/extensions/debug-non-zts-20090626/igbinary= .PHP_SHLIB_SUFFIX' > - > /usr/local/php/5.3dev/lib/php/extensions/debug-non-zts-20090626/igbinary.= PHP_SHLIB_SUFFIX: > cannot open shared object file: No such file or directory in Unknown on > line 0 thanks for the answer, in this case I think this would be a worthwhile improvement. + foreach ($extensions as $req_ext) { + $loaded =3D `$php -n -r 'echo (int) extension_loaded("$req_ext");'`; + if ($loaded =3D=3D '0') { it would be more efficient to get all the loaded modules at once(get_loaded_extensions or php -m) --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --0016e64082dcf5f5bd04b2cc2d77--