@@ 89-100 (lines=12) @@ | ||
86 | public function compileBootableClasses() |
|
87 | { |
|
88 | // list app root's |
|
89 | foreach ($this->appRoots as $app) { |
|
90 | $app .= '/Apps/Controller/' . env_name; |
|
91 | $files = File::listFiles($app, ['.php'], true); |
|
92 | foreach ($files as $file) { |
|
93 | // define full class name with namespace |
|
94 | $class = 'Apps\Controller\\' . env_name . '\\' . Str::cleanExtension($file); |
|
95 | // check if class exists (must be loaded over autoloader), boot method exist and this is controller instanceof |
|
96 | if (class_exists($class) && method_exists($class, 'boot') && is_a($class, 'Ffcms\Core\Arch\Controller', true)) { |
|
97 | $this->objects[] = $class; |
|
98 | } |
|
99 | } |
|
100 | } |
|
101 | ||
102 | // list widget root's |
|
103 | foreach ($this->widgetRoots as $widget) { |
|
@@ 103-113 (lines=11) @@ | ||
100 | } |
|
101 | ||
102 | // list widget root's |
|
103 | foreach ($this->widgetRoots as $widget) { |
|
104 | $widget .= '/Widgets/' . env_name; |
|
105 | // widgets are packed in directory, classname should be the same with root directory name |
|
106 | $dirs = Directory::scan($widget, GLOB_ONLYDIR, true); |
|
107 | foreach ($dirs as $instance) { |
|
108 | $class = 'Widgets\\' . env_name . '\\' . $instance . '\\' . $instance; |
|
109 | if (class_exists($class) && method_exists($class, 'boot') && is_a($class, 'Ffcms\Core\Arch\Widget', true)) { |
|
110 | $this->objects[] = $class; |
|
111 | } |
|
112 | } |
|
113 | } |
|
114 | } |
|
115 | ||
116 | /** |