2017 © Pedro Peláez
 

library php_forbidden

Looks into the code using a user-defined list of forbidden function in a given path.

image

nilportugues/php_forbidden

Looks into the code using a user-defined list of forbidden function in a given path.

  • Sunday, March 6, 2016
  • by nilportugues
  • Repository
  • 1 Watchers
  • 9 Stars
  • 7,218 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 1 % Grown

The README.md

PHP Forbidden Functions

Scrutinizer Code Quality SensioLabsInsight Latest Stable Version Total Downloads License Donate, (*1)

Why? Because someone should look for forbidden functions that should be avoided in production., (*2)

Typical examples are print_r, var_dump, exit and die function calls., (*3)

Installation

Use Composer to install the package:, (*4)

$ composer require --dev nilportugues/php_forbidden

Usage

It is really this simple:, (*5)

$ 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:, (*6)

$ 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):, (*7)

$ 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., (*8)

A configuration for instance, should formatted as follows:, (*9)

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:, (*10)

$  php bin/php_forbidden check -c configs/php_forbidden_function.yml src/

Contribute

Contributions to the package are always welcome!, (*11)

Support

Get in touch with me using one of the following means:, (*12)

Authors

License

The code base is licensed under the MIT license., (*13)

The Versions

06/03 2016

dev-master

9999999-dev http://nilportugues.com

Looks into the code using a user-defined list of forbidden function in a given path.

  Sources   Download

MIT

The Requires

 

The Development Requires

function hook git php functions checker fixer forbidden

09/11 2015

1.0.5

1.0.5.0 http://nilportugues.com

Looks into the code using a user-defined list of forbidden function in a given path.

  Sources   Download

MIT

The Requires

 

The Development Requires

function php functions checker fixer forbidden

09/11 2015

1.0.4

1.0.4.0 http://nilportugues.com

Looks into the code using a user-defined list of forbidden function in a given path.

  Sources   Download

MIT

The Requires

 

The Development Requires

function php functions checker fixer forbidden

07/11 2015

1.0.3

1.0.3.0 http://nilportugues.com

Looks into the code using a user-defined list of forbidden function in a given path.

  Sources   Download

MIT

The Requires

 

The Development Requires

function php functions checker fixer forbidden

06/11 2015

1.0.1

1.0.1.0 http://nilportugues.com

Looks into the code using a user-defined list of forbidden function in a given path.

  Sources   Download

MIT

The Requires

 

The Development Requires

function php functions checker fixer forbidden

06/11 2015

1.0.0

1.0.0.0 http://nilportugues.com

Looks into the code using a user-defined list of forbidden function in a given path.

  Sources   Download

MIT

The Requires

 

The Development Requires

function php functions checker fixer forbidden