com\setasign\SetaFramework

Autoloader Class Autoloader

File: /SetaFramework/src/Autoloader.php

Class hierarchy

Summary

Properties

$paths

protected array Autoloader::$paths = array()

Contains all paths


Methods

__construct()

public Autoloader::__construct (
bool $register = true,
bool $autoRegisterSetaFramework = false
)

Constructor

Parameters
$register : bool

Define whether the constructor should autoregister this object to spl_autoloader

$autoRegisterSetaFramework : bool

Define whether the constructor should autoregister the SetaFramework

__wakeup()

public Autoloader::__wakeup (
void
): void

Unserialize - Registers the autoloader to spl_autoload

addPath()

public Autoloader::addPath (
string $namespace,
string $path,
string $dirSeparator = \DIRECTORY_SEPARATOR
): self

Adds a Path to Autoloader

Parameters
$namespace : string

If you are using php5.2 namespace style (e.g. "SetaPDF_Core_Document") your namespace need to end with "" (e.g. "SetaPDF")

$path : string

Path on which the namespace can be found

$dirSeparator : string
 

getPaths()

public Autoloader::getPaths (
void
): array

Returns all defined paths

isRegistered()

public Autoloader::isRegistered (
void
): bool

Checks whether the autoloader is registered

load()

public Autoloader::load (
string $classname
): void

Loads missing classes with the paths declared with Autoloader::addPath

This method is registered as autoload_function via spl_autoload_register

Parameters
$classname : string
 

register()

public Autoloader::register (
void
): void

Register this object as autoloader

sort()

protected Autoloader::sort (
array $a,
array $b
): int

Sort the Autoloader::_paths array for faster loading

Parameters
$a : array
 
$b : array
 
See

unregister()

public Autoloader::unregister (
void
): void

Unregister this object as autoloader