- Some minor adjustements, also a WIP on the @Cronard annotation has begun
This commit is contained in:
1 parent
fd693fc8fc
commit
f72115aab4
3 files changed
+29
-3
No files matched your search
@@ -6,10 +6,13 @@ use Zend\Diactoros\Response\TextResponse;
|
||||
|
||||
use TheBugs\JavascriptMiddleware;
|
||||
|
||||
use Cronard\CronardMiddleware;
|
||||
use Cronard\CronardMiddleware,
|
||||
Notes\Cronard\TaskFetcher;
|
||||
|
||||
use Lean\Lean;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
use Storage\Cookie,
|
||||
Storage\Session,
|
||||
Storage\SessionMiddleware;
|
||||
@@ -57,6 +60,8 @@ return [
|
||||
],
|
||||
|
||||
'routes' => [],
|
||||
|
||||
'cronard' => [],
|
||||
],
|
||||
|
||||
Lean::class => autowire(Lean::class),
|
||||
@@ -66,7 +71,17 @@ return [
|
||||
return new TextResponse(sprintf("%s - cron task begin...", date('Y-m-d H:i:s')));
|
||||
});
|
||||
|
||||
return $cronardMiddleware->fromFile(getenv("META_PATH")."/crontab.php");
|
||||
return $cronardMiddleware->fromFile(getenv("META_PATH")."/crontab.php")->fromAnnotations($c->get(TaskFetcher::class));
|
||||
},
|
||||
|
||||
TaskFetcher::class => function($c) {
|
||||
$fetcher = new TaskFetcher();
|
||||
|
||||
$fetcher->setFolderList(array_map(function($item) {
|
||||
return $item;
|
||||
}, $c->get(Lean::class)->getCronard()));
|
||||
|
||||
return $fetcher;
|
||||
},
|
||||
|
||||
JavascriptMiddleware::class => create(JavascriptMiddleware::class),
|
||||
|
||||
Reference in new issue
Block a user