Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Robot Loader Laravel Package

nette/robot-loader

RobotLoader automatically loads PHP classes, interfaces, and traits from specified directories by scanning files and caching the results. It spares you from manually requiring or registering each class, making it handy for legacy code or small projects without Composer.

View on GitHub
Deep Wiki
Context7
v4.1.3
  • setCacheDirectory() replaces setTempDirectory(), matching the naming used in Latte. The old method still works as a deprecated alias, so there is no rush to change anything.
  • Writing the cache on Windows no longer fails randomly with "Access is denied". An antivirus scanning the freshly written file could hold it open just long enough to break the rename(); the write is now retried briefly before giving up. Other platforms behave exactly as before.
  • When the cache file cannot be written, the exception now tells you why instead of just naming the file.
v4.1.2

A code quality release that tightens static analysis and cleans up internals.

  • Fixed all PHPStan errors and improved phpDoc annotations
  • Switched to singleline declare statements across the codebase
v4.1.1

improved phpDoc

v4.1.0
  • requires PHP 8.1
  • support for PHP 8.5
  • optimized global function calls
v4.0.3
  • support for PHP 8.4
v4.0.2
  • md5 replaced with xxHash
  • checks whether temp directory is absolute
v4.0.1
  • support for PHP 8.3
  • fixed parser #28
  • removed Nette\SmartObject
v4.0.0
  • requires PHP 8.0
  • renamed getCacheKey() -> generateCacheKey() (BC break)
  • removed support for netterobots.txt (BC break)
v3.4.2
  • refactoring
  • support for PHP 8.2
v3.4.1
  • support for PHP 8.1
  • added support for PHP 8.1 enum #23
v3.4.0
  • Saves cache only once
  • stores list of empty PHP files
  • uses realpath() for added directories
  • refactoring
v3.3.2
  • fixed buggy behavior after 788ab3ec
v3.0.5

compatible with PHP 8.0

v2.4.5

compatible with PHP 8.0

v3.2.4

compatibility with PHP 8.0

v3.1.2
  • compatibility with PHP 8.0

For the details you can have a look at the diff.

v3.3.1
  • compatibility with PHP 8.0
  • getRealPath() can return false (in PHAR)

For the details you can have a look at the diff.

v3.3.0
  • Loads and builds cache on demand

For the details you can have a look at the diff.

v3.2.3
  • fixed renaming on windows, when it is read at the same time #11
  • added acquireLock() and better exception messages
  • ensures that $this->classes & $this->missing are not null

For the details you can have a look at the diff.

v3.2.2
  • saveCache() is atomic, fixed problem on Windows #11

For the details you can have a look at the diff.

v3.2.1
  • $this is not available in loaded file
  • RobotLoader: Fixed the empty variadic array in addDirectory() #17
  • PhpStan fixes (#16)
  • removed support for comment //netteloader

For the details you can have a look at the diff.

v3.2.0
  • requires PHP 7.1
  • uses PHP 7.1 features & declare(strict_types=1)
  • deprecated support for addDirectory($array) and excludeDirectory($array) (BC break)
  • triggers warnings when $ignoreDirs or $acceptFiles is not array (BC break)
v3.1.1
  • added refresh()
  • readme: added info about non-autoloading usage

For the details you can have a look at the diff.

v3.1.0

By default, RobotLoader reports errors in PHP files by throwing exception ParseError (since PHP 7.0). It can be disabled via $loader->reportParseErrors(false).

For the details you can have a look at the diff.

v3.0.4
  • RobotLoader: fixed exclusion when scanned dir contains .. #13
  • phpDoc: added $var name to @param

For the details you can have a look at the diff.

v3.0.3
  • throws exception when is unable to create temp directory

For the details you can have a look at the diff.

v2.4.4
  • throws exception when is unable to create temp directory

For the details you can have a look at the diff.

v3.0.2
  • supports PHP up to 7.2
  • saveCache() is atomic #11

For the details you can have a look at the diff.

v2.4.3
  • supports PHP up to 7.2
  • coding style: fixes, lowercase true/false/null

For the details you can have a look at the diff.

v3.0.1
  • coding style: fixes, lowercase true/false/null
  • default $acceptFiles & $ignoreDirs changed to arrays (BC break!)

For the details you can have a look at the diff.

v3.0.0
  • compatible with PHP 5.6
  • removed setCacheStorage() and dependency on nette/caching (BC break)
  • RobotLoader is case sensitive (BC break)
  • $autoRebuild is private (BC break)
  • getKey() renamed to getCacheKey() (BC break)
  • added RobotLoader::excludeDirectory() (#9)
v2.4.2
  • added setTempDirectory(), should be used instead of setCacheStorage()
  • presence of cacheStorage is checked only in register(), not in rebuild()

For the details you can have a look at the diff.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hotmeteor/eco-env
mvaliolahi/hydrate
wearede/tbcpay-php
parsnick/steak
thibaud-dauce/mattermost-php
multilinguals/apollo-client
antaresbr/collection
kr0lik/phpstan-rules
loco/loco
starfederation/datastar-php
yupmin/modern-phystrix
stephenjude/extended-artisan-commands
lumphp/laravel-macroable
lumphp/laravel-collections
lumphp/laravel-contracts
sermepa/sermepa
arkecosystem/fortify
arkecosystem/ui
owowagency/laravel-resources
gtjamesa/php-standards