You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+37-2Lines changed: 37 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,11 +14,13 @@ Introduction
14
14
RobotLoader is a tool that gives you comfort of automated class loading for your entire application including third-party libraries.
15
15
16
16
- get rid of all `require`
17
-
- only necessary scripts are loaded
18
17
- requires no strict file naming conventions
19
18
- allows more classes in single file
19
+
- extremely fast
20
+
- no manual cache updates, everything runs automatically
21
+
- highly mature, stable and widely used library
20
22
21
-
RobotLoader is extremely comfortable and addictive!
23
+
RobotLoader is incredibly comfortable and addictive!
22
24
23
25
If you like Nette, **[please make a donation now](https://nette.org/donate)**. Thank you!
24
26
@@ -76,3 +78,36 @@ This feature should be disabled on production server.
76
78
If you want RobotLoader to skip some directory, use `$loader->excludeDirectory('temp')`.
77
79
78
80
By default, RobotLoader reports errors in PHP files by throwing exception `ParseError` (since PHP 7.0). It can be disabled via `$loader->reportParseErrors(false)`.
81
+
82
+
83
+
PHP files analyzer
84
+
------------------
85
+
86
+
RobotLoader can also be used to find classes, interfaces, and trait in PHP files without using the autoloading feature:
87
+
88
+
```php
89
+
$loader = new Nette\Loaders\RobotLoader;
90
+
$loader->addDirectory(__DIR__ . '/app');
91
+
92
+
// Scans directories for classes / intefaces / traits
93
+
$loader->rebuild();
94
+
95
+
// Returns array of class => filename pairs
96
+
$res = $loader->getIndexedClasses();
97
+
```
98
+
99
+
When scanning files again, we can use the cache and unmodified files will not be analyzed repeatedly:
0 commit comments