\PhalApi_Loader

Loader Class

  • Load class file automatically by class name
  • Or requrire source file manually by specified path

Summary

Methods
Properties
Constants
__construct()
addDirs()
setBasePath()
loadFile()
load()
No public properties found
No constants found
loadClass()
$dirs
$basePath
N/A
No private methods found
No private properties found
N/A

Properties

$dirs

$dirs : array

Type

array — the folders to be required

$basePath

$basePath : string

Type

string — the root path

Methods

__construct()

__construct(  $basePath,   $dirs = array()) 

Parameters

$basePath
$dirs

addDirs()

addDirs(string  $dirs) : NULL

Add the folders to by required

Parameters

string $dirs

the absolute folder paths to by required

Returns

NULL

setBasePath()

setBasePath(string  $path) : NULL

Set the root path

Parameters

string $path

root path

Returns

NULL

loadFile()

loadFile(string  $filePath) 

require specified file manually

Parameters

string $filePath

relative file path, or absolute file path

load()

load(string  $className) 

Autoload

Here, the reason why we won't throw exception when class is not found, because we hope developers or other library have chance to load it later.

Parameters

string $className

the class name to be required

loadClass()

loadClass(  $path,   $className) 

Parameters

$path
$className