Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24217 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65124 invoked by uid 1010); 26 Jun 2006 09:59:31 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 65109 invoked from network); 26 Jun 2006 09:59:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jun 2006 09:59:31 -0000 X-Host-Fingerprint: 83.104.121.66 mailgate.bandvulc.co.uk Received: from ([83.104.121.66:25315] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id C3/C9-44237-200BF944 for ; Mon, 26 Jun 2006 05:59:30 -0400 Message-ID: To: internals@lists.php.net Date: Mon, 26 Jun 2006 11:00:30 +0100 User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) MIME-Version: 1.0 References: <10845a340606260150x29e57048x4eb8db50db0e2bd7@mail.gmail.com> In-Reply-To: <10845a340606260150x29e57048x4eb8db50db0e2bd7@mail.gmail.com> Content-Type: multipart/mixed; boundary="------------020008050100070309080802" X-Posted-By: 83.104.121.66 Subject: Re: Supporting version specific INI files as well as SAPI specific INI files. From: RQuadling@GMail.com (Richard Quadling) --------------020008050100070309080802 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Missing attachment! -- ------------------------------------------------------------------------ Bandvulc Group Zend PHP Certificate Richard Quadling Software Developer Telephone +44 (0) 1752 893559 extension 286 Fax +44 (0) 1752 690794 Email richard.quadling@bandvulc.co.uk --------------020008050100070309080802 Content-Type: text/plain; name="php_ini.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="php_ini.c.patch" Index: php_ini.c =================================================================== RCS file: /repository/php-src/main/php_ini.c,v retrieving revision 1.142 diff -u -r1.142 php_ini.c --- php_ini.c 8 Mar 2006 14:41:45 -0000 1.142 +++ php_ini.c 19 Jun 2006 12:16:59 -0000 @@ -428,6 +428,17 @@ } } } + /* RAQ : 2006-06-19 - Search php%php-major-version%-%sapi-module-name%.ini file in search path */ + if (!fh.handle.fp) { + const char *fmt = "php%s-%s.ini"; + char *ini_fname = emalloc(strlen(fmt) + strlen(sapi_module.name) + (PHP_MAJOR_VERSION < 10 ? 1 : 2)); // Allow for PHP 10 in many years time. + sprintf(ini_fname, fmt, PHP_MAJOR_VERSION, sapi_module.name); + fh.handle.fp = php_fopen_with_path(ini_fname, "r", php_ini_search_path, &php_ini_opened_path TSRMLS_CC); + efree(ini_fname); + if (fh.handle.fp) { + fh.filename = php_ini_opened_path; + } + } /* Search php-%sapi-module-name%.ini file in search path */ if (!fh.handle.fp) { const char *fmt = "php-%s.ini"; --------------020008050100070309080802--