Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66945 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41890 invoked from network); 4 Apr 2013 14:29:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Apr 2013 14:29:41 -0000 Authentication-Results: pb1.pair.com header.from=leight@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=leight@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.178 as permitted sender) X-PHP-List-Original-Sender: leight@gmail.com X-Host-Fingerprint: 74.125.82.178 mail-we0-f178.google.com Received: from [74.125.82.178] ([74.125.82.178:48293] helo=mail-we0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 55/41-35962-55E8D515 for ; Thu, 04 Apr 2013 09:29:41 -0500 Received: by mail-we0-f178.google.com with SMTP id z53so2069076wey.37 for ; Thu, 04 Apr 2013 07:29:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=Z7jFGBj5VDrCnqzv0AxzG66GOGDU2hj6qH7AKnkusPg=; b=Ee66uMlnqLCzj8STjlRn2Bmkt2rdZriimXlTr3losjoOZjP3Ms/3OJvRXaVuj1zBDc koKRwj8/5Q1wdk37lCo34fxL6CAVdFkdfUzjuKOz04ssWIQZTgqAlCnZ84aTUJ3w5+IZ w4w6ZkX1z1KDA2+lbh61xII58dPnmYoKEAPV4VaZoMdo9tcXX6mnTOCbcIdSPqzj9P66 V8MBwXxd23Wtvc7PhEQZ0s5KwYkv91JEWuy7un+ShE/ISQcQzYkr8e0nsYIai80GATY4 lJJPCsoRRrmQHbUuc9goxokT2/LDHN3u6gNxvV/Qwm4uqigujZJBGLvc3gmDwnHeQGKa pcXw== MIME-Version: 1.0 X-Received: by 10.194.87.229 with SMTP id bb5mr10029632wjb.32.1365085778396; Thu, 04 Apr 2013 07:29:38 -0700 (PDT) Received: by 10.217.2.209 with HTTP; Thu, 4 Apr 2013 07:29:38 -0700 (PDT) In-Reply-To: References: Date: Thu, 4 Apr 2013 15:29:38 +0100 Message-ID: To: Julien Pauli Cc: PHP Internals Content-Type: multipart/alternative; boundary=089e0102ffeae8cd0b04d989ccff Subject: Re: [PHP-DEV] Adding a way to retreive compile options at runtime From: leight@gmail.com (Leigh) --089e0102ffeae8cd0b04d989ccff Content-Type: text/plain; charset=ISO-8859-1 I think creating easy processable output from phpinfo() is a good idea in theory, but as Madara says, I'm also not sure about any other production uses for this aside from the issue at hand with curlwrappers. Are there many use cases except for the config options that this would be useful for? If not maybe a simpler php_configure_options() would be better, returning an array as you proposed in your example. Although I'm not sure about the returned format, in some cases the option is a key, and in others it's a value. I think options that do not take a value would be better represented as: '--enable-foo' => true On 4 April 2013 15:18, Julien Pauli wrote: > Hello everybody, > > Today we talked about a way to detect --with-curlwrappers at runtime. > It is nowadays not possible easilly. > > Then , I remembered I once proposed to add a new function that could return > every ./configure options used to compile the runtime PHP the code is > beeing run on. > > We already have "php-config --configure-options", but that needs to exist > and that needs an exec() call. > We also already have phpinfo() which returns that, but not in a very fancy > way (we need to preg_ the output which is ugly and not very simple). > > Today, Seldaek proposed what I think is a cool way to solve this problem : > add a new parameter to phpinfo() function, which could return in an array > what it usually directly print throught the SAPI print() function (HTMLing > the output when needed). > > The use case would be : > > $output = phpinfo(INFO_GENERAL, true); > > var_dump($output); > /* something like > ['Debug Build' =>'no', 'Thread Safety'=>'yes', 'Configure > Command'=>['--enable-foo', '--with-config-file-scan-dir'=>'/etc' > ]] > > > As you can see, it is rather simple but would need some work as it is > better for the "Configure Command" to return an array with the options > instead of a big string ; easier to parse. > > Thoughts ? > > Julien.Pauli > --089e0102ffeae8cd0b04d989ccff--