Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forbid more functions #200

Open
gmponos opened this issue Jun 17, 2020 · 0 comments
Open

Forbid more functions #200

gmponos opened this issue Jun 17, 2020 · 0 comments

Comments

@gmponos
Copy link
Contributor

gmponos commented Jun 17, 2020

Hi... I recently opened this #199

Instead of going wild and opening one by one a PR I thought about initiating a discussion here.

I believe there are more functions that can be forbidden:

'__autoload' => null,  // no reason to use this function since composer is out there

'define' => null,
'each' => null,  // @see http://php.net/manual/en/migration72.deprecated.php
'create_function' => null, // why using this?

// debug functions
'debug_backtrace' => null,
'debug_print_backtrace' => null,
'die' => null,
'exit' => null,
'phpinfo' => null,
'print_r' => null,
'var_dump' => null,

// Use a logger lib (preferably a PSR-3 one)
'error_log' => null,

// Framework debug functions
'dd' => null,
'dump' => null,

// use an HttpClient library instead.
'curl_exec' => null,
'curl_init' => null,
'curl_multi_exec' => null,

// Use a process library.. 
'exec' => null,

// The following functions should not be allowed inside a project and they should be set by your php.ini unless if you are building a very specific library.
'ini_alter' => null,
'ini_restore' => null,
'ini_set' => null,
'date_default_timezone_set' => null,

'apache_request_headers' => null, // Exists only on Apache webservers
'apache_response_headers' => null, // Exists only on Apache webservers
'getallheaders' => null, // Is an alias of apache_request_headers()

'putenv' => null, // use $_SERVER or $_ENV variable directly // https://github.com/laravel/framework/issues/7354
'getenv' => null,

ofc users can override this on their projects but it would be good to promote these as a good practice.

Let me know WDYT.. maybe discussing all this in one issue might be an overhead and I should open smaller ones?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant