File tree Expand file tree Collapse file tree 1 file changed +20
-8
lines changed Expand file tree Collapse file tree 1 file changed +20
-8
lines changed Original file line number Diff line number Diff line change 8
8
require_once __DIR__ . DIRECTORY_SEPARATOR . '.. ' . DIRECTORY_SEPARATOR . '.. ' . DIRECTORY_SEPARATOR . 'autoload.php ' ;
9
9
break ;
10
10
default :
11
- $ path = __DIR__ . DIRECTORY_SEPARATOR . 'src ' ;
11
+ requeirFiles ( __DIR__ . DIRECTORY_SEPARATOR . 'src ' ) ;
12
12
13
- $ iterator = new DirectoryIterator ($ path );
13
+ break ;
14
+ }
15
+
16
+ /**
17
+ * @param string $path
18
+ */
19
+ function requeirFiles (string $ path )
20
+ {
21
+ $ iterator = new DirectoryIterator ($ path );
14
22
15
- while ($ iterator ->valid ()) {
16
- $ item = $ iterator ->current ();
23
+ while ($ iterator ->valid ()) {
24
+ $ item = $ iterator ->current ();
17
25
26
+ if (!$ item ->isDot ()) {
18
27
if ($ item ->isFile ()) {
19
28
require_once $ path . DIRECTORY_SEPARATOR . $ item ->getFilename ();
29
+ } elseif ($ item ->isDir ()) {
30
+ requeirFiles ($ item ->getPathname ());
20
31
}
21
-
22
- unset($ item );
23
- $ iterator ->next ();
24
32
}
25
33
26
- break ;
34
+ unset($ item );
35
+ $ iterator ->next ();
36
+ }
37
+
38
+ unset($ iterator );
27
39
}
You can’t perform that action at this time.
0 commit comments