{"id":16587774,"url":"https://github.com/daltonmenezes/eventscheduler","last_synced_at":"2026-05-21T16:01:54.483Z","repository":{"id":56961506,"uuid":"54228307","full_name":"daltonmenezes/eventScheduler","owner":"daltonmenezes","description":"A simple event scheduler application for PHP projects.","archived":false,"fork":false,"pushed_at":"2018-11-16T09:56:05.000Z","size":1233,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-16T20:55:07.177Z","etag":null,"topics":["behavior","event","php","schedule","trigger"],"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/daltonmenezes.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":"2016-03-18T20:03:17.000Z","updated_at":"2024-05-03T09:16:46.000Z","dependencies_parsed_at":"2022-08-21T09:20:54.410Z","dependency_job_id":null,"html_url":"https://github.com/daltonmenezes/eventScheduler","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daltonmenezes%2FeventScheduler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daltonmenezes%2FeventScheduler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daltonmenezes%2FeventScheduler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daltonmenezes%2FeventScheduler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daltonmenezes","download_url":"https://codeload.github.com/daltonmenezes/eventScheduler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242180384,"owners_count":20085154,"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":["behavior","event","php","schedule","trigger"],"created_at":"2024-10-11T22:55:01.309Z","updated_at":"2025-12-04T17:16:59.909Z","avatar_url":"https://github.com/daltonmenezes.png","language":"PHP","funding_links":["https://www.patreon.com/daltonmenezes"],"categories":[],"sub_categories":[],"readme":"# eventScheduler\n\u003ca href=\"https://www.patreon.com/daltonmenezes\"\u003e\u003cimg src=\"https://img.shields.io/badge/become%20a-patron%20or%20sponsor-orange.svg\" alt=\"become a patron or sponsor\" /\u003e\u003c/a\u003e\n[![Build Status](https://travis-ci.org/daltonmenezes/eventScheduler.svg?branch=master)](https://travis-ci.org/daltonmenezes/eventScheduler) [![Code Climate](https://codeclimate.com/github/daltonmenezes/eventScheduler/badges/gpa.svg)](https://codeclimate.com/github/daltonmenezes/eventScheduler)\n\nA simple event scheduler application for PHP projects. \n\n# Installation\n\nThe Package is available on [Packagist](https://packagist.org/packages/daltonmenezes/eventscheduler),\nyou can install it using [Composer](http://getcomposer.org).\n\n```bash\ncomposer require daltonmenezes/eventscheduler\n```\n### Dependencies\n\n- [PHP](https://php.net) 5.3+\n\n## How it works?\n\nSetting a start and finish date, you can trigger different events for each.\n\nThe behavior you set to be triggered on the start date is defined by after() event;\n\nThe behavior you set to be triggered while the start date is not reached is the before() event;\n\nWhen the finish date is reached, after() event is suspended, as well before() event too.\n\nThe finish date is optional, if you want the after() event continues in your project execution without date limitations, simply do not set the key \"finish\" in your array.\n\n## Usage\nInstantiate EventScheduler\\EventScheduler.\n```php\nuse EventScheduler\\EventScheduler;\n\n$event = new EventScheduler();\n```\nDefine a start date in your schedule, its must be an array.\n```php\n$schedule = array(\"start\" =\u003e \"18-03-2016 23:43\");\n```\nThe start key is for when your event must be triggered. If you want define a finish date for shutdown it, you must define a finish key in your array.\n\n```php\n$schedule = array(\n\t\"start\" =\u003e \"18-03-2016 23:43\",\n\t\"finish\" =\u003e \"20-03-2020 19:13\"\n);\n```\n\nNow, call the schedule method for set your array.\n\n```php\n$event-\u003eschedule($schedule);\n```\n\nCall the before() method for set this behavior. The parameter must be a Closure.\nIf you do not want call and define this method, it's ok. It's optional.\n\n```php\n$event-\u003ebefore(function() {\n\t// define here whatever you want execute as an expected behavior\n});\n```\nCall the after() method for set this behavior. The parameter must be a Closure.\nIf you do not want call and define this method, it's ok. It's optional.\n\n```php\n$event-\u003eafter(function() {\n\t// define here whatever you want execute as an expected behavior\n});\n```\n\nCall the run() method for when all is done!\n\n```php\n$event-\u003erun();\n```\nNothing more! It's simple! ;)\nYou can read or test the [example.php](https://github.com/daltonmenezes/eventScheduler/blob/master/example.php) file at the root directory of this project.\n\n## Problems or suggestions?\n\nOpen a [Issue](https://github.com/daltonmenezes/eventScheduler/issues). :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaltonmenezes%2Feventscheduler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaltonmenezes%2Feventscheduler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaltonmenezes%2Feventscheduler/lists"}