{"id":19638014,"url":"https://github.com/simon28082/event","last_synced_at":"2025-10-09T16:13:57.716Z","repository":{"id":56958814,"uuid":"93108552","full_name":"simon28082/event","owner":"simon28082","description":null,"archived":false,"fork":false,"pushed_at":"2019-10-28T12:34:19.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-09T16:13:57.223Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simon28082.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-01T23:42:33.000Z","updated_at":"2019-10-28T12:33:56.000Z","dependencies_parsed_at":"2022-08-21T05:10:11.224Z","dependency_job_id":null,"html_url":"https://github.com/simon28082/event","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/simon28082/event","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simon28082%2Fevent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simon28082%2Fevent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simon28082%2Fevent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simon28082%2Fevent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simon28082","download_url":"https://codeload.github.com/simon28082/event/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simon28082%2Fevent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001762,"owners_count":26083171,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-11T12:37:24.131Z","updated_at":"2025-10-09T16:13:57.666Z","avatar_url":"https://github.com/simon28082.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Example\n\n### Set the scheduler\n```$xslt\nExample::setDispatcher(new \\CrCms\\Event\\Dispatcher);\n```\n\n### Register event\n```$xslt\nExample::registerEvent('event1',$listener);\n```\n\n### Push event listener\n```$xslt\nExample::pushEvent('event1',$listener);\n```\n\n### Listening method\n\n```$xslt\n\n//first\n$listener =\u003e ExampleListener1::class@listen\n\n//second\n$listener =\u003e ExampleListener2::class\n\n//third\n$listener =\u003e function($object) {\n    ...\n}\n\nclass ExampleListener1\n{\n    public function listen($object)\n    {\n        ...\n    }\n}\n\nclass ExampleListener2\n{\n    public function handle($object)\n    {\n        ...\n    }\n}\n\nfunction($object) {\n    ...\n}\n\n```\n\n### Event trigger\n\n```$xslt\nclass Example {\n\n    use CrCms\\Event\\HasEvents;\n    \n    # Set events\n    public static function events() : array\n    {\n        return ['event1','event2'];\n    }\n    \n    public function example()\n    {\n        # Trigger event\n        Example::fireEvent('event1',$listener);\n    }\n}\n\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimon28082%2Fevent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimon28082%2Fevent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimon28082%2Fevent/lists"}