Login   Register  
PHP Classes
elePHPant
Icontem

File: README.md

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Sebastian Potasiak  >  Galaxy Loader  >  README.md  >  Download  
File: README.md
Role: Documentation
Content type: text/plain
Description: Readme file
Class: Galaxy Loader
Register class loaders based on file path rules
Author: By
Last change:
Date: 2 years ago
Size: 1,822 bytes
 

Contents

Class file image Download
Galaxy Loader v0.3
================

This package contains loaders classes and interfaces and abstractions, which 
will help you implement your own loader class.

There are two built-in loaders:

gfLoader
-------
* Registering library directories
* Registering class files extensions
* Creates full path changing namespace into relative file path
* Manual finding and laoding clsses
* Saving and loading classes maps

gfLoaderExtended
--------------
* Extends gfLoader, so has all it's features, excluding way it finds classes
* Registering namespaces and it's paths
* Creates full path checking available namespace paths

Example
------

    <?php
    require_once 'lib/gf/Loader/Exception.php';
    require_once 'lib/gf/Loader/gfLoaderInterface.php';
    require_once 'lib/gf/Loader/gfLoaderManualInterface.php';
    require_once 'lib/gf/Loader/gfLoaderMappableInterface.php';
    require_once 'lib/gf/Loader/gfLoaderAbstraction.php';
    require_once 'lib/gf/Loader/gfLoader.php';
    
    use \gf\Loader\gfLoader;
    use \gf\Loader\gfLoaderExtended;
    
    $Loader = new gfLoader();
    
    $Loader->registerDirectory('lib')
           ->registerExtension('php')
           ->register();
    
    $Extended = new gfLoaderExtended();
    
    $Extended->registerDirectory('lib')
             ->registerExtension('php')
             ->registerNamespace('gf\\Loader', 'gf/Loader/')
             ->register();
          
In this example you can see all of the basic functionalities of _Galaxy Loader_.
For more, look at comments in code.

Loaders are stacked in SPL autoload handlers stack, so when you are registering
a new loader, the old one is not unregistered. To unregister loader use:
    
    $Loader->unregister();
    
More information about every class and developing your own implementations
comming soon.