Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33163 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67555 invoked by uid 1010); 15 Nov 2007 19:45:29 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 67540 invoked from network); 15 Nov 2007 19:45:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Nov 2007 19:45:29 -0000 Received: from [127.0.0.1] ([127.0.0.1:10412]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ECSTREAM id 43/D2-63493-9D1AC374 for ; Thu, 15 Nov 2007 14:45:29 -0500 X-Host-Fingerprint: 83.3.93.34 gnp34.internetdsl.tpnet.pl Date: Thu, 15 Nov 2007 13:38:37 -0500 Received: from [83.3.93.34] ([83.3.93.34:1412] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 66/FE-63493-C229C374 for ; Thu, 15 Nov 2007 13:38:37 -0500 To: internals@lists.php.net Keywords: php.ini config Summary: php configuration variables Message-ID: User-Agent: slrn/0.9.8.1pl1 (Debian) X-Posted-By: 83.3.93.34 Subject: php.ini values extension From: pwadas@jewish.org.pl (Piotr Wadas) Hello, I'm writing php extension to read php.ini settings from independent location, particularly some object or relational database, or, sleepycat db. PHP ini development concept seems pretty straightforward to me, anyway I can't figure out how to make a php.ini setting to be "admin value", e.g. not changeable with ini_set() function from within php script, whatever access type its definition has. I looked into apache mod_php5 module source, to find out how php_admin_value/flag is implemented, and it seems there's special handler, different than "normal" variable change handler. Type of php.ini variable access is controlled via third argument to PHP_INI_ENTRY() macro, anyway php_admin_value implementation overrides it somehow, I mean no matter what kind of access was defined with the variable definition in php source, if the value is set with php_admin_value, it is not changeable later, and this is exactly what I want. There's also a modification handler for php.ini variables, but obviously this is also variable-definition setting, I mean, if e.g. modfication handler for mysql.port is onUpdateString, I cannot in my extension change it to OnOtherUpdateStringProcedure, as mysql extension's php ini variables are already defined in mysql extension source. Anyway with mod_php php_admin_value/flag does it somehow (make php ini variable unchangeable). To be exact - I want to set any php.ini variable inside extension code - and this is something I know how to do it - and mark it to be "admin value" (not changeable later) - and this is something I cannot figure out. I actually use php as cgi/fcgi, and since I noticed, that command-line specified variable (-d switch) is not automatically marked as "admin value" (works according with variable access type). The only one advanced php api information I could find was "Extending and Embedding PHP" book, written by Sara Golemon, anyway php.ini chapter does not say anything about overriding original access type setting. Regards, DT