Ask a Question related to PHP Development, Design and Development.
-
Dennis Sterzenbach #1
[PHP-DEV] retrieving information about state of a function
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
[url]www.darknoise.de[/url]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: [url]http://www.php.net/unsub.php[/url]
Dennis Sterzenbach Guest
-
Retrieving information from website
Hi I have a very basic question regd retrieving information from website using a scripting language: Basically I am working on the development... -
cfquery errors on Package or function LIST is in an invalid state
I am trying to understand an error I got from my cfquery I created a function using TOAD like: create or replace function list ( field1 number... -
more information for SRF function
Hello, this is questions for hackers. Is possible put SRF functions more informations about context of calling SRF function? Not now. I know, but... -
How can I use session state information in a serveruser control
Hi, once a user has logged in I want to use some variable in the other custom server controls I've developed. In the page, where the controls are... -
Setting a default state for Multi-State buttons
I'm using the multi-state button behavior and would like to have one button set ON as the default when the app first runs. Is it possible to set the... -
Derick Rethans #2
Re: [PHP-DEV] retrieving information about state of a function
On Wed, 1 Oct 2003, Dennis Sterzenbach wrote:
You can either use function_exists() to check if a function is> 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.
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 [url]http://derickrethans.nl/[/url]
International PHP Magazine [url]http://php-mag.net/[/url]
-------------------------------------------------------------------------
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: [url]http://www.php.net/unsub.php[/url]
Derick Rethans Guest
-
Dennis Sterzenbach #3
RE: [PHP-DEV] retrieving information about state of a function
>
function_exists() NEVER informs about the function being> You can either use function_exists() to check if a function is
> available, or use "ini_get('disabled_functions')".
>
> Derick
>
disabled or not it does inform about (I cite the manual here:)
"if the given function has been defined".
So it does NOT tell me anything about state.
If you had read my post, you knew I already do like you telling
me, but do not agree with this solution, as it is better
in performance etc. (see my post) to let PHP do so.
Also it isn't consequent to have info about existance of a func
but not about its disabled/enabled state.
Regards
Dennis
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: [url]http://www.php.net/unsub.php[/url]
Dennis Sterzenbach Guest
-
Derick Rethans #4
RE: [PHP-DEV] retrieving information about state of a function
On Wed, 1 Oct 2003, Dennis Sterzenbach wrote:
Of course... why do you NEED to know if it's not available or> function_exists() NEVER informs about the function being> >
> > You can either use function_exists() to check if a function is
> > available, or use "ini_get('disabled_functions')".
> >
> > Derick
> >
> disabled or not it does inform about (I cite the manual here:)
> "if the given function has been defined".
>
> So it does NOT tell me anything about state.
disabled... the result is the same: you can not use the function.
I did read it, I just don't see any point why it is useful.> If you had read my post, you knew I already do like you telling
> me, but do not agree with this solution, as it is better
> in performance etc. (see my post) to let PHP do so.
Derick
--
"Interpreting what the GPL actually means is a job best left to those
that read the future by examining animal entrails."
-------------------------------------------------------------------------
Derick Rethans [url]http://derickrethans.nl/[/url]
International PHP Magazine [url]http://php-mag.net/[/url]
-------------------------------------------------------------------------
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: [url]http://www.php.net/unsub.php[/url]
Derick Rethans Guest
-
Dennis Sterzenbach #5
RE: [PHP-DEV] retrieving information about state of a function
> Of course... why do you NEED to know if it's not available or
Sure.> disabled... the result is the same: you can not use the function.
>
But still it is a difference if my code is stable or not. Using an
own implementation telling about the disabled state makes it stable.
Also code should be performant. It isn't when reading a list of
comma seperated function names to a string, afterwards checking if
strpos() !== false.
I bet ZendEngine knows about all disabled functions, as it should to
block the usage. Also I bet it doesn't read the list each time a
function gets called, neither per request to some script.
So the list is persistant, access per C code.
And the performance and safety is layed down to PHP.
IMHO that's more performant, more secure and even more professional.
Sorry for the tone, didn't want to be rough.>> > If you had read my post, you knew I already do like you telling
> > me, but do not agree with this solution, as it is better
> > in performance etc. (see my post) to let PHP do so.
> I did read it, I just don't see any point why it is useful.
I hope you agree with my statement, now.
Regards
Dennis
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: [url]http://www.php.net/unsub.php[/url]
Dennis Sterzenbach Guest
-
Dennis Sterzenbach #6
RE: [PHP-DEV] retrieving information about state of a function
Oh and what about having disabled the ini_get/ini_set methods:
<?php
print ini_get('disable_functions');
?>
Warning: ini_get,ini_set() has been disabled for security reasons
That's making the problem quite enormous.
Dennis
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: [url]http://www.php.net/unsub.php[/url]
Dennis Sterzenbach Guest
-
Re: [PHP-DEV] retrieving information about state of a function
Hi,
This won't work in PHP 5.0 because it comes with print/echo disabled> Oh and what about having disabled the ini_get/ini_set methods:
> ...
> print ini_get('disable_functions');
> ...
> Warning: ini_get,ini_set() has been disabled for security reasons
by default for security reasons.
This will help getting rid of XSS vulnerabilities and unwanted
errormessages.
Just for your information.
Stefan
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: [url]http://www.php.net/unsub.php[/url]
Guest
-
Derick Rethans #8
Re: [PHP-DEV] retrieving information about state of a function
On Wed, 1 Oct 2003 [email]se@nopiracy.de[/email] wrote:
What the hell are you talking about?>> > Oh and what about having disabled the ini_get/ini_set methods:
> > ...
> > print ini_get('disable_functions');
> > ...
> > Warning: ini_get,ini_set() has been disabled for security reasons
> This won't work in PHP 5.0 because it comes with print/echo disabled
> by default for security reasons.
>
> This will help getting rid of XSS vulnerabilities and unwanted
> errormessages.
>
> Just for your information.
Derick
--
"Interpreting what the GPL actually means is a job best left to those
that read the future by examining animal entrails."
-------------------------------------------------------------------------
Derick Rethans [url]http://derickrethans.nl/[/url]
International PHP Magazine [url]http://php-mag.net/[/url]
-------------------------------------------------------------------------
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: [url]http://www.php.net/unsub.php[/url]
Derick Rethans Guest
-
Re: [PHP-DEV] retrieving information about state of a function
Hi Derick,
I thought it would be obvious that I was ironically criticizing> What the hell are you talking about?
the idea of disabling ini_get etc... And that i was just kidding.
Stefan
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: [url]http://www.php.net/unsub.php[/url]
Guest



Reply With Quote

