{"id":14984098,"url":"https://github.com/m-adamski/symfony-schedule-bundle","last_synced_at":"2025-04-10T19:43:29.190Z","repository":{"id":62521075,"uuid":"121233383","full_name":"m-adamski/symfony-schedule-bundle","owner":"m-adamski","description":"Bundle for Symfony simplifying operations with CRON jobs","archived":false,"fork":false,"pushed_at":"2024-02-02T10:22:23.000Z","size":50,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"4.0","last_synced_at":"2025-03-24T17:21:27.183Z","etag":null,"topics":["php","schedule-bundle","symfony","symfony-bundle"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/m-adamski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-12T10:34:59.000Z","updated_at":"2024-07-14T22:16:55.000Z","dependencies_parsed_at":"2024-09-24T15:27:44.439Z","dependency_job_id":"e0a5e5a5-9bad-49de-8cae-4e0113187a90","html_url":"https://github.com/m-adamski/symfony-schedule-bundle","commit_stats":{"total_commits":20,"total_committers":4,"mean_commits":5.0,"dds":"0.15000000000000002","last_synced_commit":"958c9d723a6373c4905c9e729d0d3e724cebc24f"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-adamski%2Fsymfony-schedule-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-adamski%2Fsymfony-schedule-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-adamski%2Fsymfony-schedule-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-adamski%2Fsymfony-schedule-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m-adamski","download_url":"https://codeload.github.com/m-adamski/symfony-schedule-bundle/tar.gz/refs/heads/4.0","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248281424,"owners_count":21077423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","schedule-bundle","symfony","symfony-bundle"],"created_at":"2024-09-24T14:08:26.503Z","updated_at":"2025-04-10T19:43:29.167Z","avatar_url":"https://github.com/m-adamski.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Schedule Bundle for Symfony\n\nBundle for simplifying operations with CRON jobs.\n\n## Installation\n\nThis Bundle can be installed by Composer:\n\n```\n$ composer require m-adamski/symfony-schedule-bundle\n```\n\n## How to use it?\n\nBundle provide functionality to manage CRON jobs by configuration from specified file.\nWe need to create class implementing ``Adamski\\Symfony\\ScheduleBundle\\Model\\ManagerInterface`` interface.\n\n```(php)\nnamespace App\\Model;\n\nuse Adamski\\Symfony\\ScheduleBundle\\Model\\ManagerInterface;\nuse Adamski\\Symfony\\ScheduleBundle\\Model\\Schedule;\n\nclass ScheduleManager implements ManagerInterface {\n\n    public function schedule(Schedule $schedule) {\n        // TODO: ..\n    }\n}\n```\n\nThen we need to complete the configuration - create file ``config/packages/schedule.yaml`` and set path to ScheduleManager:\n\n```(yaml)\nschedule:\n    manager: App\\Model\\ScheduleManager\n```\n\n## Command schedule configuration\n\nIn function ``schedule`` we can configure CRON jobs with required expressions.\nFor example we want run ``app:test-command`` daily at 12:00:\n\n```(php)\npublic function schedule(Schedule $schedule) {\n    $schedule-\u003ecommand(\"app:test-command\")-\u003edailyAt(\"12:00\");\n}\n```\n\nSchedule class provide many date-time manipulators. This functionality is inspired by Laravel Tasks Scheduling.\n\n## Schedule Frequency Options\n\nThere are many schedules that you can assign to your task.\n\n| Method                                         |\n| ---------------------------------------------- |\n| cron($expression)                              |\n| everyMinute()                                  |\n| everyFiveMinutes()                             |\n| cron($expression)                              |\n| everyMinute()                                  |\n| everyFiveMinutes()                             |\n| everyTenMinutes()                              |\n| everyFifteenMinutes()                          |\n| everyThirtyMinutes()                           |\n| hourly()                                       |\n| hourlyAt(int $offset)                          |\n| daily()                                        |\n| at(string $time)                               |\n| dailyAt(string $time)                          |\n| twiceDaily(int $first = 1, int $second = 13)   |\n| weekdays()                                     |\n| weekends()                                     |\n| mondays()                                      |\n| tuesdays()                                     |\n| wednesdays()                                   |\n| thursdays()                                    |\n| fridays()                                      |\n| saturdays()                                    |\n| sundays()                                      |\n| weekly()                                       |\n| weeklyOn(int $day, string $time = \"0:0\")       |\n| monthly()                                      |\n| monthlyOn(int $day = 1, string $time = \"0:0\")  |\n| twiceMonthly(int $first = 1, int $second = 16) |\n| quarterly()                                    |\n| yearly()                                       |\n| days($days)                                    |\n\n## CRON\n\nNow it's enough to insert only one entry into crontab on server:\n\n```\n* * * * * php /path-to-project/bin/console schedule:run \u003e\u003e schedule.log 2\u003e\u00261\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm-adamski%2Fsymfony-schedule-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm-adamski%2Fsymfony-schedule-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm-adamski%2Fsymfony-schedule-bundle/lists"}