Provides a set of classes for PHP applications.
Note: This is an unstable repository in development and should be treated as an alpha.
- PHP 5.5 or greater
- CakePHP Utility Classes 3.0.5 or grater - Only needed
Cake\Utility\Text
class, that should be loaded. There is a copy of that class intovendor
directory to be auto-used if CakePHP Utility Classes is not available.
In your vendor directory, type:
git submodule add https://github.com/nelson6e65/php_nml.git
git submodule init
git submodule update
Or you can also clone using ssh auth:
git submodule add [email protected]:nelson6e65/php_nml.git
git submodule init
git submodule update
This installs NML into your Vendor directory as php_nml
.
- Download NML from releases, master-tar.gz or master-zip.
- Unzip that download.
- Rename the resulting folder to
php_nml
. - Then copy/move this folder into your vendor directory
This library implements an auto-load system even for non-composer installs.
First you should import autoload.php
file from php_nml
root directory into your app configuration file:
<?php
//app/config.php
//Other configs of your application...
require_once('path/to/your/app/Vendor/php_nml/autoload.php');
//...
Then, the library classes will be available to use:
<?php
//Example of use of Version class:
use NelsonMartell\Version;
$nmlVersion = new Version(0, 3);
echo $nmlVersion.ToString();
Note: If you dont' use CakePHP Utility Classes, there is a minimal copy of needed class in php_nml/vendor/Cake/Utility
directory. This autoload.php
includes php_nml/vendor/autoload.php
file to autoloads psr-4 classes from that vendor
.
For more details about available classes from NML, you can check the API Documentation.
You can, optionally, define the CODE_ANALYSIS
constant if you like some notices and warnings to be
throws while you are coding/debugging. This is useful to watch some recommendations about usage of
some clases, functions, methods, etc.
<?php
//Other configs of your application
//..
define('CODE_ANALYSIS', true);
//...