limboniatech / limbonia-loader
This is the Limbonia Loader
v1.0.6
2020-06-25 18:34 UTC
Requires
- php: ^7.2
Requires (Dev)
- phpunit/phpunit: ^8
README
Installation
Using composer:
- Add the library to the project
> cd project-dir/ > composer require limboniatech/limbonia-loader
2 . Make sure the vendor autoload statement at the top of your file
<?php require 'vendor/autoload.php';
Using a raw library:
- Add the library to the project
> cd project-dir/ > git clone https://github.com/limboniatech/limbonia-loader.git
2 . Make sure the autoloader.php statement at the top of your file
<?php require $sPathToLimboniaTechLibs . '/limbonia-loader/autoloader.php';
Usage
Loader class method list
DriverList trait method list
Adding the DriverList trait in a class
- Add the trait to a base class
<?php namespace Limbonia; class Sample { use \Limbonia\Traits\DriverList; }
- Extend that class into a group of sub-classes
<?php namespace Limbonia\Sample; class Foo extends \Limbonia\Sample { }
<?php namespace Limbonia\Sample; class Bar extends \Limbonia\Sample { }
<?php namespace Limbonia\Sample; class Baz extends \Limbonia\Sample { }
- Then use the features of the trait where ever you need them...
<?php namespace Limbonia\Test; use \Limbonia\Sample; print_r(Sample::driverList()); $sSampleFooDriverClass = Sample::driverClass('foo); $oSample = new $sSampleFooDriverClass; echo $oSample->getType() . "\n";