473,395 Members | 1,915 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

php.ini extension development

DT
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 <pw****@jewish.org.pl>
Nov 15 '07 #1
6 2521
"DT" <pw****@jewish.org.plwrote in message
news:a0**********************************@c30g2000 hsa.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 <pw****@jewish.org.pl>


Nov 15 '07 #2
DT
>
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.
Nov 15 '07 #3
On Thu, 15 Nov 2007 15:06:42 +0100, DT <pw****@jewish.org.plwrote:
>>
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
Nov 15 '07 #4
"DT" <pw****@jewish.org.plwrote in message
news:12**********************************@p69g2000 hsa.googlegroups.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.
Nov 15 '07 #5
On Thu, 15 Nov 2007 21:30:06 +0100, Sanders Kaufman <bu***@kaufman.net
wrote:
"DT" <pw****@jewish.org.plwrote in message
news:12**********************************@p69g2000 hsa.googlegroups.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.
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
Nov 15 '07 #6
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" <lu************@hotmail.comwrote in message
news:op***************@metallium.lan...
On Thu, 15 Nov 2007 21:30:06 +0100, Sanders Kaufman <bu***@kaufman.net>
"DT" <pw****@jewish.org.plwrote 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

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


Nov 16 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Gyger | last post by:
Hello, Three weeks ago, I have started to develop a binding extension for Qt and PHP 5. Now, I can display a dialog box containing some widgets like label, buttons and edit line. I have just...
4
by: Mike Walsh | last post by:
I would like to use PHP's Sybase extension. I am running my development area on Windows under IIS. When I enable the Sybase extension, I get a message that indicates the extension didn't load. ...
10
by: John Underwood | last post by:
Can I use python23_d and python23 to develop an extension for a commercial application uses python22.dll? (Providing that I do not use any new features found only in 2.3.) I would bulld version...
5
by: Matt | last post by:
I currently have a client that is okay with us using Microsoft development products but do not want their customers to see the aspx extension on any of the web pages. I played around with creating...
7
by: Adam | last post by:
Im trying to add an httphandler for all *.sgf file extensions. I have developed the handler, 1. installed it into the gac 2. added it to the machine.config: <httpHandlers> <add verb="*"...
2
by: Michael Hudson | last post by:
The PyPy development team has been busy working and we've now packaged our latest improvements, completed work and new experiments as version 0.9.0, our fourth public release. The highlights of...
3
by: SMH | last post by:
Template Document Processor: PHP 5.1.6 Server: Apache httpd 2.0.55 (Win32) Database Server: MySQL 5.0.26-community for Win32 Operating System: ...
1
by: Petr Prikryl | last post by:
Do you think that the following could became PEP (pre PEP). Please, read it, comment it, reformulate it,... Abstract Introduction of the mechanism for language extensions via modules...
7
by: Danny | last post by:
Hello: I would like to develop a browser extension, or whatever such a thing is classified as, that would allow a user of IE6, and possibly IE7, to switch between a live and development page. ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.