php.ini extension development | | |
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 <pwadas@jewish.org.pl> | | | | re: php.ini extension development
"DT" <pwadas@jewish.org.plwrote in message
news:a04c847d-60e1-49c0-8da2-6d82c2131360@c30g2000hsa.googlegroups.com... Quote:
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. Quote:
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>
>
>
| | | | re: php.ini extension development
> Quote:
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'm Unix programmer, I intend to write php extension in C, and I mean
PHP language environment source, not PHP script code.
I cannot find any PHP core development newsgroup, so I post here,
hoping php C hackers read it :)
Regards,
P. | | | | re: php.ini extension development
On Thu, 15 Nov 2007 15:06:42 +0100, DT <pwadas@jewish.org.plwrote: Quote: Quote:
>>
>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'm Unix programmer, I intend to write php extension in C, and I mean
PHP language environment source, not PHP script code.
I cannot find any PHP core development newsgroup, so I post here,
hoping php C hackers read it :)
Allthough it wouldn't be offtopic here, extension internals are not an
issue dealt with here on a regular basis. For more information on PHP
extensions & internals, I'd advise looking at the available resources at
<http://pecl.php.net/support.phpand/or the internal developers list
<news://news.php.net/php.internals>
--
Rik Wasmus | | | | re: php.ini extension development
"DT" <pwadas@jewish.org.plwrote in message
news:123b9303-f36c-4099-a6c9-614e2764c4f8@p69g2000hsa.googlegroups.com... Quote: Quote:
>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'm Unix programmer, I intend to write php extension in C, and I mean
PHP language environment source, not PHP script code.
I cannot find any PHP core development newsgroup, so I post here,
hoping php C hackers read it :)
Ahhh - so you gots the chops.
My IPP helped me out with that one.
....I was just about to point you to a *great* site for that.
Then I saw that slimebag return-address of yours and decided to just tell
you to sod off.
So - sod off. | | | | re: php.ini extension development
On Thu, 15 Nov 2007 21:30:06 +0100, Sanders Kaufman <bucky@kaufman.net
wrote: Quote:
"DT" <pwadas@jewish.org.plwrote in message
news:123b9303-f36c-4099-a6c9-614e2764c4f8@p69g2000hsa.googlegroups.com.... Quote: Quote:
>
>>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'm Unix programmer, I intend to write php extension in C, and I mean
>PHP language environment source, not PHP script code.
>I cannot find any PHP core development newsgroup, so I post here,
>hoping php C hackers read it :)
>
Ahhh - so you gots the chops.
My IPP helped me out with that one.
>
...I was just about to point you to a *great* site for that.
Then I saw that slimebag return-address of yours and decided to just tell
you to sod off.
WTF? Other then that polish isn't one of the languages I know, and I can't
really see what the site is about
(<http://www.tranexp.com:2000/InterTran?type=url&url=http%3A%2F%2Fwww.jewish.org .pl%2F&text=&from=pol&to=eng
was not of any help) I can't see any problem?
--
Rik Wasmus | | | | re: php.ini extension development
For some reason, a lot of whackos think that .PL stands for Palestine.
I don't know *why* they think that - but in the political groups, a lot of
jew-bashers use it that way.
I see this a LOT in the newsgroups.
So, when I saw this one - I presumed it was another like that.
But I'll be damned - Jewish.org.pl is real!
And I'm a friggin idiot.
That said...
The site to which I referred, is the PHP.net newsgroups, mentioned earlier
by you, I think.
"Rik Wasmus" <luiheidsgoeroe@hotmail.comwrote in message
news:op.t1upknvg5bnjuv@metallium.lan...
On Thu, 15 Nov 2007 21:30:06 +0100, Sanders Kaufman <bucky@kaufman.net> Quote:
"DT" <pwadas@jewish.org.plwrote in message
Quote:
...I was just about to point you to a *great* site for that.
Then I saw that slimebag return-address of yours and decided to just tell
you to sod off.
WTF? Other then that polish isn't one of the languages I know, and I can't
really see what the site is about
(<http://www.tranexp.com:2000/InterTran?type=url&url=http%3A%2F%2Fwww.jewish.org .pl%2F&text=&from=pol&to=eng>
was not of any help) I can't see any problem? |  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,449 network members.
|