$object){ if (FALSE === in_array (pathinfo($name, PATHINFO_EXTENSION), $extensions, true)) { continue; } $hash = ''; $file_content = file_get_contents($name); foreach(token_get_all($file_content) as $token) { if ($token[0] != 319) { continue; } if (in_array($token[1], $functions_blacklist, true)) { if ('' === $hash) { $hash = hash('sha256', $file_content); } echo 'sp.disable_function.function("' . $token[1] . '").filename("' . $name . '").hash("' . $hash . '").allow();' . "\n"; } } } foreach($functions_blacklist as $fun) { echo 'sp.disable_function.function("' . $fun . '").drop();' . "\n"; }