nilportugues/php_forbidden
最新稳定版本:1.0.5
Composer 安装命令:
composer require nilportugues/php_forbidden
包简介
Looks into the code using a user-defined list of forbidden function in a given path.
README 文档
README
Why? Because someone should look for forbidden functions that should be avoided in production.
Typical examples are print_r, var_dump, exit and die function calls.
Installation
Use Composer to install the package:
$ composer require --dev nilportugues/php_forbidden
Usage
It is really this simple:
$ php bin/php_forbidden check <path/to/directory>
$ php bin/php_forbidden check <path/to/file>
You can also pipe STDIN in, if you want to use this tool with Gulp for instance:
$ cat <path/to/file> | php bin/php_forbidden check
which means that this also works writing code directly from the shell (if you have some reason to do it):
$ php bin/php_forbidden check
<?php
// Insert your code
// and press CTRL+D to send EOF
Configuration file
When run the first time, if no php_forbidden_function.yml file is found, it will be generated.
A configuration for instance, should formatted as follows:
forbidden: - file_get_contents - fopen - die - var_dump - print_r
You can specify an alternate location for the configuration file by passing in the -c parameter. Example:
$ php bin/php_forbidden check -c configs/php_forbidden_function.yml src/
Contribute
Contributions to the package are always welcome!
- Report any bugs or issues you find on the issue tracker.
- You can grab the source code at the package's Git repository.
Support
Get in touch with me using one of the following means:
- Emailing me at contact@nilportugues.com
- Opening an Issue
Authors
License
The code base is licensed under the MIT license.
统计信息
- 总下载量: 8.09k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-11-06