PHP Plus!
PHP, but better., (*1)
Add new functionality to PHP with a range of helper functions that make life easier., (*2)
Got a common function people should know about? Add a pull request, and get helping!, (*3)
How to install
Composer
Simply add stevenkellow/php-plus to your composer.json file., (*4)
Download
Simply download PHP Plus and put the folder somewhere within your project., (*5)
Then, just add one line of code into a project file (replacing PATH_TO_PHP_PLUS with the directory of the folder ), (*6)
include_once( PATH_TO_PHP_PLUS . '/classes/php-plus.php' );, (*7)
and you'll be done., (*8)
How to use
Version 1.1 comes with a loader, so you can choose when to include PHP Plus and which files you need., (*9)
To run with all functions, simply use:, (*10)
PHPPlus::load();, (*11)
This method accepts two paramaters, $include and $exclude so you can fine tune which files to load., (*12)
If you only want to load certain files, add them to the include array like so:, (*13)
PHPPlus::load( array( 'constants', 'math' ) );, (*14)
If you want to exclude certain files, add them to the exclude array like so:, (*15)
PHPPlus::load( false, array( 'strings', 'security' ) );, (*16)
The include paramater defaults to using all files, while the exclude paramater defaults to excluding no files, so there's no real need to mix and match those two!, (*17)