@@ 300-320 (lines=21) @@ | ||
297 | * |
|
298 | * @return array |
|
299 | */ |
|
300 | public static function load(\Monolog\Logger $logger) { |
|
301 | ||
302 | $table = new Events($logger); |
|
303 | ||
304 | if ( defined("EXTENDER_PLUGINS_CONFIG") && is_readable(EXTENDER_PLUGINS_CONFIG) ) { |
|
305 | ||
306 | $events = Spyc::YAMLLoad(EXTENDER_PLUGINS_CONFIG); |
|
307 | ||
308 | foreach ($events as $event) { |
|
309 | ||
310 | $method = empty($event["data"]["method"]) ? null : $event["data"]["method"]; |
|
311 | ||
312 | $table->add($event["data"]["event"], $event["data"]["class"], $method); |
|
313 | ||
314 | } |
|
315 | ||
316 | } |
|
317 | ||
318 | return $table; |
|
319 | ||
320 | } |
|
321 | ||
322 | } |
|
323 |
@@ 175-195 (lines=21) @@ | ||
172 | * |
|
173 | * @return array |
|
174 | */ |
|
175 | public static function load(\Monolog\Logger $logger) { |
|
176 | ||
177 | $table = new TasksTable($logger); |
|
178 | ||
179 | if ( defined("EXTENDER_TASKS_CONFIG") && is_readable(EXTENDER_TASKS_CONFIG) ) { |
|
180 | ||
181 | $tasks = Spyc::YAMLLoad(EXTENDER_TASKS_CONFIG); |
|
182 | ||
183 | foreach ($tasks as $task => $parameters) { |
|
184 | ||
185 | $description = empty($parameters["data"]["description"]) ? null : $parameters["data"]["description"]; |
|
186 | ||
187 | $table->add($task, $parameters["data"]["class"], $description); |
|
188 | ||
189 | } |
|
190 | ||
191 | } |
|
192 | ||
193 | return $table; |
|
194 | ||
195 | } |
|
196 | ||
197 | /** |
|
198 | * Check if task is registered |