You are here: Re: php.ini extension development « PHP Programming Language « IT news, forums, messages
Re: php.ini extension development

Posted by Sanders Kaufman on 11/15/07 10:30

"DT" <pwadas@jewish.org.pl> wrote in message
news:a04c847d-60e1-49c0-8da2-6d82c2131360@c30g2000hsa.googlegroups.com...
> 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.

That has to be done in the installation - can't be done through php code.
You'll have to know a lot about compiling, *nix security and such to get it
right.





> 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 <pwadas@jewish.org.pl>
>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация