PATCH: disable_functions perdir

php.internals

Tvrtko Ursulin

22 years ago
Hello again, Some time ago I posted this patch but nobody commented. Anyone?

Keith Roberts

22 years ago
Hi list! I'm no php developer, just a few ideas really. Would it be possible to disable all unused functions per group, that are compiled into php4, using directives in php.ini? Could be ideal for testing purposes, and for others that want to use different configurations of the same php_module, without having to keep compiling different flavoured versions. Should also help in tightening up security issues too. Something like: php.ini ... Disable_XYZ On|Off # Which would disable ALL functions for that particular # group, such as: Disable_Filesystem On|Off # would disable all the functions in the filesystem group Disable_Directory On|Off # would disable all functions in the directory group # Then to selectively allow the ENABLING of required # functions from a particular group, use something like: Enable_Filesystem_functions move_uploaded_file, rename # which would allow use of the above 2 functions from the # filesystem group, but still leaving the others disabled. ... Obviously, there must be a number of core functions that php needs, and these probably cannot be disabled. Would this be practical? Kind Regards - Keith Roberts

Wez Furlong

22 years ago
> I'm no php developer, just a few ideas really.
Ack
> Disable_Filesystem On|Off > # would disable all the functions in the filesystem group > > Disable_Directory On|Off > # would disable all functions in the directory group
It would mean having some kind of structure to categorize all the internal functions, and that would add a significant amount of maintenance to the core. On that basis, I doubt you will see it in PHP itself. However, you could probably code a PECL extension that does this pretty easily. --Wez.