php.ini extension development

php.ini extension development

am 15.11.2007 10:56:46 von pwadas

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

Re: php.ini extension development

am 15.11.2007 11:30:53 von Bucky Kaufman

"DT" wrote in message
news:a04c847d-60e1-49c0-8da2-6d82c2131360@c30g2000hsa.google groups.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
>
>

Re: php.ini extension development

am 15.11.2007 15:06:42 von pwadas

>
> 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

am 15.11.2007 15:25:17 von luiheidsgoeroe

On Thu, 15 Nov 2007 15:06:42 +0100, DT wrote:

>>
>> 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
and/or the internal developers list


--
Rik Wasmus

Re: php.ini extension development

am 15.11.2007 21:30:06 von Bucky Kaufman

"DT" wrote in message
news:123b9303-f36c-4099-a6c9-614e2764c4f8@p69g2000hsa.google groups.com...
> >
>> 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

am 15.11.2007 21:51:49 von luiheidsgoeroe

On Thu, 15 Nov 2007 21:30:06 +0100, Sanders Kaufman =
=

wrote:

> "DT" wrote in message
> news:123b9303-f36c-4099-a6c9-614e2764c4f8@p69g2000hsa.google groups.com=
....
>> >
>>> 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 t=
ell
> 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 =

( w.jewish.org.pl%2F&text=3D&from=3Dpol&to=3Deng> =

was not of any help) I can't see any problem?
-- =

Rik Wasmus

Re: php.ini extension development

am 16.11.2007 03:40:37 von Bucky Kaufman

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" wrote in message
news:op.t1upknvg5bnjuv@metallium.lan...
On Thu, 15 Nov 2007 21:30:06 +0100, Sanders Kaufman
> "DT" wrote in message

> ...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

(
was not of any help) I can't see any problem?