class RobotLoader

Nette auto loader is responsible for loading classes and interfaces.

$loader = new Nette\Loaders\RobotLoader; $loader->addDirectory('app'); $loader->excludeDirectory('app/exclude'); $loader->setTempDirectory('temp'); $loader->register();

Traits

Strict class for better experience.

Constants

RETRY_LIMIT

Properties

array $ignoreDirs
array $acceptFiles

Methods

__construct()

No description

register(bool $prepend = false)

Register autoloader.

void
tryLoad(string $type)

Handles autoloading of classes, interfaces or traits.

addDirectory(string ...$paths)

Add path or paths to list.

reportParseErrors(bool $on = true)

No description

excludeDirectory(string ...$paths)

Excludes path or paths from list.

array
getIndexedClasses()

No description

void
rebuild()

Rebuilds class list cache.

void
refresh()

Refreshes class list cache.

setAutoRefresh(bool $on = true)

Sets auto-refresh mode.

setTempDirectory(string $dir)

Sets path to temporary directory.

array
getCacheKey()

No description

Details

at line 64
__construct()

at line 75
RobotLoader register(bool $prepend = false)

Register autoloader.

Parameters

bool $prepend

Return Value

RobotLoader

at line 86
void tryLoad(string $type)

Handles autoloading of classes, interfaces or traits.

Parameters

string $type

Return Value

void

at line 123
RobotLoader addDirectory(string ...$paths)

Add path or paths to list.

Parameters

string ...$paths absolute path

Return Value

RobotLoader

at line 134
RobotLoader reportParseErrors(bool $on = true)

Parameters

bool $on

Return Value

RobotLoader

at line 145
RobotLoader excludeDirectory(string ...$paths)

Excludes path or paths from list.

Parameters

string ...$paths absolute path

Return Value

RobotLoader

at line 159
array getIndexedClasses()

Return Value

array of class => filename

at line 172
void rebuild()

Rebuilds class list cache.

Return Value

void

at line 185
void refresh()

Refreshes class list cache.

Return Value

void

at line 398
RobotLoader setAutoRefresh(bool $on = true)

Sets auto-refresh mode.

Parameters

bool $on

Return Value

RobotLoader

at line 408
RobotLoader setTempDirectory(string $dir)

Sets path to temporary directory.

Parameters

string $dir

Return Value

RobotLoader

at line 470
protected array getCacheKey()

Return Value

array