Skip to content

Automatically loads classes from a given path separated in modules

License

Notifications You must be signed in to change notification settings

thielicious/aLoad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 

Repository files navigation

aLoad

Automatically loads PHP files from a given path based on a modular separator.



INTRODUCTION

aLoad ('a' abbr. for auto) is a flexible auto file loader primarily based on a modular separator.

SETUP INFORMATION

This script requires no additional frameworks or libraries.

Use your CLI and enter the following to clone:
git clone https://github.com/thielicious/aLoad.git

USAGE

aLoad::register(array module || aLoad::ALL, [string folderpath]);

Simply register modules and define the foldername if your PHP classes reside in a different directory.

  • modules are separated file contents. Usually classes are named "class" e.g. email.class.php and additional code that is included are called "inc" e.g. utilities.inc.php. Feel free to name them however you want.
  • If you don't want to use modules, you may use the constant "aLoad::ALL" as the first parameter to register all PHP scripts which have no modules.
  • Leave the parameter for the foldername blank if your scripts are in your root directory.
  • Feel free to remove or change the namespace.

EXAMPLE


require_once "scripts/aLoad.class.php";
aLoad::register(["class", "inc"], "scripts/");

This example above will register all PHP files containing the module name "class" and "inc" in the folder "scripts".


require_once "aLoad.class.php";
aLoad::register(aLoad::ALL);

This above will register all PHP files without modules in your root directory.



If you encounter any bugs, feel free to open up an issue, thank you.

thielicious.github.io

Releases

No releases published

Packages

No packages published

Languages