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();

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|string[] $path)

Add path or paths to list.

reportParseErrors($on = true)

No description

excludeDirectory(string|string[] $path)

Excludes path or paths from list.

array
getIndexedClasses()

No description

void
rebuild()

Rebuilds class list cache.

void
refresh()

Refreshes class list cache.

setAutoRefresh($on = true)

Sets auto-refresh mode.

setTempDirectory($dir)

Sets path to temporary directory.

array
getCacheKey()

No description

Details

at line 62
__construct()

No description

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

Register autoloader.

Parameters

bool $prepend

Return Value

RobotLoader

at line 88
void tryLoad(string $type)

Handles autoloading of classes, interfaces or traits.

Parameters

string $type

Return Value

void

at line 136
RobotLoader addDirectory(string|string[] $path)

Add path or paths to list.

Parameters

string|string[] $path

absolute path

Return Value

RobotLoader

at line 146
RobotLoader reportParseErrors($on = true)

No description

Parameters

$on

Return Value

RobotLoader

at line 158
RobotLoader excludeDirectory(string|string[] $path)

Excludes path or paths from list.

Parameters

string|string[] $path

absolute path

Return Value

RobotLoader

at line 168
array getIndexedClasses()

No description

Return Value

array

of class => filename

at line 182
void rebuild()

Rebuilds class list cache.

Return Value

void

at line 196
void refresh()

Refreshes class list cache.

Return Value

void

at line 416
RobotLoader setAutoRefresh($on = true)

Sets auto-refresh mode.

Parameters

$on

Return Value

RobotLoader

at line 427
RobotLoader setTempDirectory($dir)

Sets path to temporary directory.

Parameters

$dir

Return Value

RobotLoader

at line 497
protected array getCacheKey()

No description

Return Value

array

Traits

SmartObject