mirror of
https://github.com/symfony/recipes.git
synced 2026-09-14 08:36:27 +03:00
Create Flex endpoint
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"aliases": {
|
||||
"schedule": "symfony/scheduler",
|
||||
"scheduler": "symfony/scheduler",
|
||||
"scheduling": "symfony/scheduler"
|
||||
},
|
||||
"recipes": {
|
||||
"symfony/scheduler": [
|
||||
"7.2",
|
||||
"8.2"
|
||||
]
|
||||
},
|
||||
"recipe-conflicts": [],
|
||||
"versions": [],
|
||||
"branch": "main",
|
||||
"is_contrib": false,
|
||||
"_links": {
|
||||
"repository": "github.com/symfony/recipes",
|
||||
"origin_template": "{package}:{version}@github.com/symfony/recipes:main",
|
||||
"recipe_template": "https://raw.githubusercontent.com/symfony/recipes/flex/pull-1573/{package_dotted}.{version}.json",
|
||||
"recipe_template_relative": "{package_dotted}.{version}.json",
|
||||
"archived_recipes_template": "https://raw.githubusercontent.com/symfony/recipes/flex/pull-1573/archived/{package_dotted}/{ref}.json",
|
||||
"archived_recipes_template_relative": "archived/{package_dotted}/{ref}.json"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/scheduler": {
|
||||
"manifest": {
|
||||
"copy-from-recipe": {
|
||||
"src/": "%SRC_DIR%/"
|
||||
}
|
||||
},
|
||||
"files": {
|
||||
"src/Schedule.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Component\\Scheduler\\Attribute\\AsSchedule;",
|
||||
"use Symfony\\Component\\Scheduler\\Schedule as SymfonySchedule;",
|
||||
"use Symfony\\Component\\Scheduler\\ScheduleProviderInterface;",
|
||||
"use Symfony\\Contracts\\Cache\\CacheInterface;",
|
||||
"",
|
||||
"#[AsSchedule]",
|
||||
"class Schedule implements ScheduleProviderInterface",
|
||||
"{",
|
||||
" public function __construct(",
|
||||
" private CacheInterface $cache,",
|
||||
" ) {",
|
||||
" }",
|
||||
"",
|
||||
" public function getSchedule(): SymfonySchedule",
|
||||
" {",
|
||||
" return (new SymfonySchedule())",
|
||||
" ->stateful($this->cache) // ensure missed tasks are executed",
|
||||
" ->processOnlyLastMissedRun(true) // ensure only last missed task is run",
|
||||
"",
|
||||
" // add your own tasks here",
|
||||
" // see https://symfony.com/doc/current/scheduler.html#attaching-recurring-messages-to-a-schedule",
|
||||
" ;",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "caea3c928ee9e1b21288fd76aef36f16ea355515"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"manifests": {
|
||||
"symfony/scheduler": {
|
||||
"manifest": {
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
}
|
||||
},
|
||||
"files": {
|
||||
"config/packages/scheduler.yaml": {
|
||||
"contents": [
|
||||
"framework:",
|
||||
" scheduler:",
|
||||
" use_messenger_routing: true",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
},
|
||||
"src/Schedule.php": {
|
||||
"contents": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App;",
|
||||
"",
|
||||
"use Symfony\\Component\\Scheduler\\Attribute\\AsSchedule;",
|
||||
"use Symfony\\Component\\Scheduler\\Schedule as SymfonySchedule;",
|
||||
"use Symfony\\Component\\Scheduler\\ScheduleProviderInterface;",
|
||||
"use Symfony\\Contracts\\Cache\\CacheInterface;",
|
||||
"",
|
||||
"#[AsSchedule]",
|
||||
"class Schedule implements ScheduleProviderInterface",
|
||||
"{",
|
||||
" public function __construct(",
|
||||
" private CacheInterface $cache,",
|
||||
" ) {",
|
||||
" }",
|
||||
"",
|
||||
" public function getSchedule(): SymfonySchedule",
|
||||
" {",
|
||||
" return (new SymfonySchedule())",
|
||||
" ->stateful($this->cache) // ensure missed tasks are executed",
|
||||
" ->processOnlyLastMissedRun(true) // ensure only last missed task is run",
|
||||
"",
|
||||
" // add your own tasks here",
|
||||
" // see https://symfony.com/doc/current/scheduler.html#attaching-recurring-messages-to-a-schedule",
|
||||
" ;",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"executable": false
|
||||
}
|
||||
},
|
||||
"ref": "2f08866d3b0fb1243ab13ce3ecda8a9e9645a61a"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user