{"id":16666502,"url":"https://github.com/patricknelson/taskscheduler","last_synced_at":"2026-04-21T18:05:38.652Z","repository":{"id":19707751,"uuid":"22962992","full_name":"patricknelson/TaskScheduler","owner":"patricknelson","description":"Schedule tasks using minimal PHP code.","archived":false,"fork":false,"pushed_at":"2014-11-12T15:44:35.000Z","size":192,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-19T16:32:17.119Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/patricknelson.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}},"created_at":"2014-08-14T17:45:50.000Z","updated_at":"2014-10-29T02:37:07.000Z","dependencies_parsed_at":"2022-08-24T07:20:49.424Z","dependency_job_id":null,"html_url":"https://github.com/patricknelson/TaskScheduler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patricknelson%2FTaskScheduler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patricknelson%2FTaskScheduler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patricknelson%2FTaskScheduler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patricknelson%2FTaskScheduler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patricknelson","download_url":"https://codeload.github.com/patricknelson/TaskScheduler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243310324,"owners_count":20270774,"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":[],"created_at":"2024-10-12T11:11:11.002Z","updated_at":"2025-12-11T19:03:20.646Z","avatar_url":"https://github.com/patricknelson.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"TaskScheduler\n=============\n\nSchedule tasks using minimal PHP code.\n\nUseful for scheduling tasks to run at specific times or intervals without having to write much custom logic or do any manual persistence of the last time a specific task has been run. It's a good idea to have this run every minute.\n\n\n## Example Usage ##\n\n```php\n\u003c?php\n\n// Setup the a CUSTOM implementation of the TaskStorageInterface to persist task information.\n// Simply has two accessible methods:  -\u003eset($settingName, $data) and -\u003eget($settingName, $defaultValue = false)\n$storage = new TaskStorage(__DIR__ . \"/tasks.dat\");\n\n// Will setup a task to run only on first Mondays and Tuesdays of every month, every 15 minutes during those days.\n$task = new TaskScheduler(\"my-task\", $storage);\n$task-\u003esetInterval($task::FREQ_MIN, 15);\n$task-\u003esetWeekdays(array(\n    $task::DAY_MON,\n    $task::DAY_TUE,\n));\n\n// Uses \"and\" logic in combination with weekdays.\n$task-\u003esetDays(array(1, 2, 3, 4, 5, 6, 7));\n\n// To use \"or\" logic, uncomment this line so it will fire on the first 7 days of the week OR on every Mon/Tue of the month.\n//$task-\u003esetOrLogic(true);\n\n// Useful if the cron only runs once every 5 minutes, or, if the -\u003erun() method executes after a long script.\n$task-\u003esetTimeThreshold(3); // Allows up to 3 minutes after the scheduled time and will still attempt a run.\n\n// Check to see if task should run...\nif ($task-\u003erun()) {\n    // Do something here.\n} else {\n    // See why it didn't work.\n    dump($task-\u003egetFailReason());\n}\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatricknelson%2Ftaskscheduler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatricknelson%2Ftaskscheduler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatricknelson%2Ftaskscheduler/lists"}