Hi,
I recognized there isn't any built-in function which
tells the disabled/enabled state of some function.
I think of something like:
if (function_enabled("shell_exec")) {
$info = shell_exec("dig myname.com");
}
telling if shell_exec is disabled by php.ini setting
or not.
I already implemented a check which uses an ini_get() to
retrieve the list of disabled functions, but I think it
would be more smooth having a function provided by PHP
for that purpose, because there are functions for all the
other kinds of checks: included files, declared classes,
defined constants/variables, defined functions, etc.
Why not having a function which gives information about
disabled/enabled state of a function?
I think if the function was provided by PHP makes it
faster. -Think of having to explode() and in_array() check
for the function. The PHP engine could simply have the
list of disabled functions to hand a true/false directly
from C code. Which seems to be the more consequent and
ideal solution.
--
Dennis Sterzenbach
www.darknoise.de
Hi,
I recognized there isn't any built-in function which
tells the disabled/enabled state of some function.
I think of something like:if (function_enabled("shell_exec")) {
$info = shell_exec("dig myname.com");
}telling if shell_exec is disabled by php.ini setting
or not.
You can either use function_exists() to check if a function is
available, or use "ini_get('disabled_functions')".
Derick
--
"Interpreting what the GPL actually means is a job best left to those
that read the future by examining animal entrails."
Derick Rethans http://derickrethans.nl/
International PHP Magazine http://php-mag.net/