solupro / rdfunc

A PHP Extension support wildcard-character(*) to disabled functions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rdfunc

A PHP Extension support wildcard-character(*) to disabled functions

####Install

$/path/to/phpize
$./configure --with-php-config=/path/to/php-config/
$make && make install

####Example

  • edit your php.ini
[rdfunc]
extension=rdfunc.so
rdfunc.disable_functions=array_*,str_*
  • restart server

test.php

<?php
$arr = array(1, 2, 3);
array_pop($arr);
$str = 'foobar';
$str = str_replace('foo', 'baz', $str);

var_dump($arr, $str);
  • view the page

ouput

Warning: rdfunc: array_pop has been disabled! (°Д°≡°д°)エッ!? in /Users/solu/Workspace/PHP/index.php on line 3

Warning: rdfunc: str_replace has been disabled! (°Д°≡°д°)エッ!? in /Users/solu/Workspace/PHP/index.php on line 5
array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } NULL

Blog (in Chinese)

About

A PHP Extension support wildcard-character(*) to disabled functions

License:The Unlicense


Languages

Language:C 92.1%Language:PHP 7.9%