2017 © Pedro Peláez
 

library loader

Simple loader that is designed to work with both classes and normal PHP files.

image

awps/loader

Simple loader that is designed to work with both classes and normal PHP files.

  • Monday, December 18, 2017
  • by awps
  • Repository
  • 1 Watchers
  • 0 Stars
  • 20 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 25 % Grown

The README.md

Loader

A simple loader that is designed to work with both classes and normal PHP files., (*1)

Installation

With composer:

composer require awps/loader

Manually:

require_once 'getloader.php';

Usage

Load PHP classes:

Awps\Loader::loadClasses( $path, $namespace );

This will autoload all PHP classes from $path and will assume that the namespace in those classes is $namespace;, (*2)

Load simple PHP files:

Awps\Loader::loadFiles( $path, $pattern );

This will autoload all php files from $path that contains $pattern in their name., (*3)

Examples

// Autoload classes from `inc` folder and set the namespace to `Awesome`
Awps\Loader::loadClasses( __DIR__ . 'inc', 'Awesome' );

// Now you can initialize a class. For example: 
new Awesome\Something();

// -------------------------------------------------------

// Include all php files from `functions`
Awps\Loader::loadFiles( __DIR__ . 'functions', 'component-' );

// This one will include all php files that contains `component-` string in their name
// from `functions` directory.
// Now you may call a function defined in one of those files. For example: 
do_something_special();

The Versions

18/12 2017

dev-master

9999999-dev

Simple loader that is designed to work with both classes and normal PHP files.

  Sources   Download

GPL-3.0+

The Requires

  • php >=5.3.0

 

18/12 2017

1.0.1

1.0.1.0

Simple loader that is designed to work with both classes and normal PHP files.

  Sources   Download

GPL-3.0+

The Requires

  • php >=5.3.0

 

18/12 2017

1.0.0

1.0.0.0

Simple loader that is designed to work with both classes and normal PHP files.

  Sources   Download

GPL-3.0+

The Requires

  • php >=5.3.0