limboniatech/limbonia-loader

This is the Limbonia Loader

v1.0.6 2020-06-25 18:34 UTC

This package is auto-updated.

Last update: 2024-10-26 04:37:17 UTC


README

Installation

Using composer:

  1. 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:

  1. 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

  1. Add the trait to a base class
<?php
namespace Limbonia;

class Sample
{
  use \Limbonia\Traits\DriverList;
}
  1. 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
{
}
  1. 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";