2017 © Pedro Peláez
 

library tale-loader

A small and lightweight PSR-4 and PSR-0 compatible loader

image

talesoft/tale-loader

A small and lightweight PSR-4 and PSR-0 compatible loader

  • Saturday, May 21, 2016
  • by TorbenKoehn
  • Repository
  • 3 Watchers
  • 0 Stars
  • 39 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Tale Loader

A Tale Framework Component, (*1)

What is Tale Loader?

A PSR-4 and PSR-0 compatible loader without other dependencies, (*2)

Installation

Install via Composer, (*3)

composer require "talesoft/tale-loader:*"
composer install

Usage

Assuming the following structure:, (*4)

/library
    /App.php
    /App
        /Middleware.php
    /Db.php
    /Db/Table.php

do, (*5)

use Tale\Loader;


$loader = new Loader(__DIR__.'/library');
$loader->register();

and you're done., (*6)

To disable the loader you can unregister it (which it will do automatically upon destruction), (*7)

$loader->unregister();

If you want to map a namespace on your directory, use the second argument, (*8)

$loader = new Loader(__DIR__.'/vendor/my/app', 'My\\App\\');

If your files are named differently, use the third parameter, (*9)

$loader = new Loader(__DIR__.'/lib', 'My\\', '%s.class.php');

That's all it can do any probably ever will. Maybe optional class maps will be implemented., (*10)

The Versions

21/05 2016

dev-master

9999999-dev http://docs.talesoft.io/tale-framework/tale/loader

A small and lightweight PSR-4 and PSR-0 compatible loader

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

by Torben Koehn

loader

01/03 2016

0.1

0.1.0.0 http://docs.talesoft.io/tale-framework/tale/loader

A small and lightweight PSR-4 and PSR-0 compatible loader

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

by Torben Koehn

loader