Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:4634 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30313 invoked by uid 1010); 1 Oct 2003 09:25:12 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 30279 invoked from network); 1 Oct 2003 09:25:11 -0000 Received: from unknown (HELO mail.dpits.de) (217.69.169.169) by pb1.pair.com with SMTP; 1 Oct 2003 09:25:11 -0000 Received: (qmail 30779 invoked by uid 1505); 1 Oct 2003 09:25:16 -0000 Received: from lists@darknoise.de by dpits1.dpits.de by uid 1502 with qmail-scanner-1.16 (clamscan: 0.54. spamassassin: 2.53. Clear:. Processed in 0.427565 secs); 01 Oct 2003 09:25:16 -0000 Received: from p508578c7.dip.t-dialin.net (HELO noggi) (80.133.120.199) by mail.dpits.de with SMTP; 1 Oct 2003 09:25:16 -0000 To: "ML PHP Internals" Date: Wed, 1 Oct 2003 11:26:26 +0200 Message-ID: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2727.1300 Importance: Normal X-Spam-Rating: mail.dpits.de 1.6.2 0/1/N Subject: retrieving information about state of a function From: lists@darknoise.de ("Dennis Sterzenbach") 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