Req #66729 [Opn->Wfx]: Introduce a means to test if a function has been disabled via disable_functions

From: Date: Mon, 17 Feb 2014 23:58:10 +0000
Subject: Req #66729 [Opn->Wfx]: Introduce a means to test if a function has been disabled via disable_functions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184340@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66729&edit=1 ID: 66729 Updated by: requinix@php.net Reported by: johnbillion+php at gmail dot com Summary: Introduce a means to test if a function has been disabled via disable_functions -Status: Open +Status: Wont fix Type: Feature/Change Request Package: *Configuration Issues PHP Version: Irrelevant Block user comment: N Private report: N New Comment: function_exists() does that. Previous Comments: ------------------------------------------------------------------------ [2014-02-17 21:23:23] johnbillion+php at gmail dot com Description: ------------ Feature request. It is possible to disable PHP functions via the disable_functions directive in php.ini. However, there is no method of testing, at runtime, whether a given function has been disabled by this means, The common way to detect whether a function has been disabled is to inspect the return value of ini_get('disable_functions'). This is far from optimal, especially if ini_get() itself has been disabled. A function should be introduced which accepts a function name and returns a boolean value stating whether the function has been disabled. Example: if ( ! function_disabled('exec') ) { exec( $command ) } Alternatively, to avoid the double negative, it could be named something like function_enabled() or function_available(). ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=66729&edit=1

« previous php.bugs (#184340) next »