FPHP Loader: Load one or more PHP scripts from a directory

Recommend this page to a friend!
  Info   View files Example   View files View files (13)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 258 All time: 7,707 This week: 450Up
Version License PHP version Categories
fphp_loader 1.9GNU General Publi...5PHP 5, Files and Folders, Language
Description Author

This class can load one or more PHP scripts from a directory.

It can take a given directory and loads all files with valid extension in that directory that have a given file name extension.

The class supports multiple file name extensions to check and defaults to .php .

The script files can be loaded with either include or require.

Picture of Leonardo Mauro Pereira Moraes
  Performance   Level  
Name: Leonardo Mauro Pereira ... <contact>
Classes: 3 packages by
Country: Brazil Brazil

 

Details

FPHP_Loader

Links: PHP Classes and Github

Class of autoload was based on PSR standards to import the classes. Split the main class FPHP_Loader in two: ClassLoader and FileLoader.

___

This class loader files from direct paths, or folder path. The class supports multiple file name extensions to check and defaults to .php . The script files can be loaded with either include or require.

___

/php/
  |__ autoload.php
  |__ /fphp/
  |     |__ /loader/
  |            |__ ClassLoader.php
  |            |__ FileLoader.php
  |            |__ ErrorParserLoader.php
  |__ /example/

/example/
  |__ index.file.loader.php [e.g. FileLoader]
  |__ index.class.loader.php [e.g. ClassLoader]

  • autoload.php: Config and active the class autoload [use ClassLoader];
  • ClassLoader.php: Loader of classes (php);
  • FileLoader.php: Loader of files (any type);
  • ErrorParserLoader.php: Error parser of FileLoader;

___

Example Autoload

Require autoload and call the classes

require('./php/autoload.php');
use \Example\SuperHero as IronMan;

IronMan::says();

Example FileLoader

Require autoload and call the classes

require('./php/autoload.php');
use \FPHP_Loader\FileLoader;

$ext = ['html', 'htm'];
$loader = new FileLoader();
$loader->add_extensions($ext);
$loader->load_file('header.php');
$loader->load_dir('content/');

___

Also look ~

  Files folder image Files  
File Role Description
Files folder imagedist (1 directory)
Files folder imageexample (3 files, 1 directory)
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  dist  
File Role Description
Files folder imagephp (1 file, 2 directories)

  Files folder image Files  /  dist  /  php  
File Role Description
Files folder imageexample (2 files)
Files folder imagefphp (1 directory)
  Accessible without login Plain text file autoload.php Conf. Configuration script

  Files folder image Files  /  dist  /  php  /  example  
File Role Description
  Plain text file Bob.php Class Class source
  Plain text file SuperHero.php Class Class source

  Files folder image Files  /  dist  /  php  /  fphp  
File Role Description
Files folder imageloader (3 files)

  Files folder image Files  /  dist  /  php  /  fphp  /  loader  
File Role Description
  Plain text file ClassLoader.php Class Class source
  Plain text file ErrorParserLoader.php Class Class source
  Plain text file FileLoader.php Class Class source

  Files folder image Files  /  example  
File Role Description
Files folder imagedir_example (3 files)
  Accessible without login Plain text file 1.top.php Aux. Auxiliary script
  Accessible without login Plain text file index.class.loader.php Example Example script
  Accessible without login Plain text file index.file.loader.php Example Example script

  Files folder image Files  /  example  /  dir_example  
File Role Description
  Accessible without login HTML file 1.content.html Data Auxiliary data
  Accessible without login HTML file 2.bottom.htm Data Auxiliary data
  Accessible without login Plain text file wrong_extension.txt Doc. Documentation

 Version Control Unique User Downloads Download Rankings  
 100%
Total:258
This week:0
All time:7,707
This week:450Up

For more information send a message to info at phpclasses dot org.