Download the PHP package axy/evil without Composer
On this page you can find all versions of the php package axy/evil. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package evil
Short Description Necessary evil
License MIT
Homepage https://github.com/axypro/evil
Informations about the package evil
axy\evil
- The library does not require any dependencies.
- Tested on PHP 5.4+, PHP 7, HHVM (on Linux), PHP 5.5 (on Windows).
- Install:
composer require axy/evil. - License: MIT.
Documentation
Some language features are not recommended for frequent use.
eval(), exit, global variables, direct access to super-global arrays.
But sometimes it is necessary. If you use static code analyzer, it will swear. We'll have to suppress messages.
This library encapsulates the "evil" features. You simply call methods and disclaims any sin.
API
Classes are in the namespace axy\evil.
Evil
It contains calls of "evil" functions.
So how exit, echo and etc is keywords methods have other names.
eval - execCode
exit - stop
breakpoint()
Shows debugging information and terminates the current script (with the status from $status).
If $message is not a scalar then used print_r().
If specified $line: shows the line number of the breakpoint.
For $file shows the file name.
In CLI mode the $message completes new line.
In HTTP mode the $message enclosed in <pre>.
echo - out
Sends a string to the stdout stream.
Superglobals
Static methods of axy\evil\Superglobals:
getSERVER()getGET()getPOST()getREQUEST()getCOOKIE()getFILES()getSESSION()getENV()
Return the corresponding superglobals arrays. The data is returned by reference.
Globals
Static methods:
getGLOBALS(): returns$_GLOBALSby referenceget($name [, $default]): returns the value of a global variable (or$defaultif the variable not found)set($name, $value): setremove($name): unset