Added pages to view the list of potential jobs

TODO: add ability to run a job & view queued jobs
This commit is contained in:
2023-05-31 16:23:18 +01:00
parent 9b2da13e3a
commit 119e932154
9 changed files with 353 additions and 1 deletions

View File

@@ -11,8 +11,10 @@ namespace UserFrosting\Sprinkle\Worker\ServicesProvider;
use Illuminate\Container\Container;
use Psr\Container\ContainerInterface;
use Twig\Extra\Intl\IntlExtension;
use UserFrosting\Sprinkle\Worker\Worker\Worker;
use UserFrosting\Sprinkle\Core\ServicesProvider\BaseServicesProvider;
use UserFrosting\Sprinkle\Worker\Jobs\JobInspector;
/**
* Worker services provider.
@@ -49,5 +51,20 @@ class ServicesProvider
$container['jobInspector'] = function ($c) {
return new JobInspector($c);
};
/*
* Extends the 'view' service with the HasRole extension for Twig.
*
* @return \Slim\Views\Twig
*/
$container->extend('view', function ($view, $c) {
$twig = $view->getEnvironment();
if (!$twig->hasExtension('Twig\Extra\Intl\IntlExtension')) {
$twig->addExtension(new IntlExtension());
}
return $view;
});
}
}