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.

excludeDirectory(string|string[] $path)

Excludes path or paths from list.

array
getIndexedClasses()

No description

void
rebuild()

Rebuilds class list cache.

setAutoRefresh($on = true)

Sets auto-refresh mode.

setTempDirectory($dir)

Sets path to temporary directory.

array
getCacheKey()

No description

Details

at line 59
__construct()

No description

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

Register autoloader.

Parameters

bool $prepend

Return Value

RobotLoader

at line 85
void tryLoad(string $type)

Handles autoloading of classes, interfaces or traits.

Parameters

string $type

Return Value

void

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

Add path or paths to list.

Parameters

string|string[] $path

absolute path

Return Value

RobotLoader

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

Excludes path or paths from list.

Parameters

string|string[] $path

absolute path

Return Value

RobotLoader

at line 155
array getIndexedClasses()

No description

Return Value

array

of class => filename

at line 169
void rebuild()

Rebuilds class list cache.

Return Value

void

at line 365
RobotLoader setAutoRefresh($on = true)

Sets auto-refresh mode.

Parameters

$on

Return Value

RobotLoader

at line 376
RobotLoader setTempDirectory($dir)

Sets path to temporary directory.

Parameters

$dir

Return Value

RobotLoader

at line 448
protected array getCacheKey()

No description

Return Value

array

Traits

SmartObject