{"id":13623281,"url":"https://github.com/cakephp/event","last_synced_at":"2026-04-02T18:43:41.436Z","repository":{"id":20019872,"uuid":"23287674","full_name":"cakephp/event","owner":"cakephp","description":"[READ-ONLY] The event dispatcher library for CakePHP. This repo is a split of the main code that can be found in https://github.com/cakephp/cakephp","archived":false,"fork":false,"pushed_at":"2026-03-15T06:16:25.000Z","size":254,"stargazers_count":22,"open_issues_count":0,"forks_count":3,"subscribers_count":26,"default_branch":"5.x","last_synced_at":"2026-03-15T18:07:42.303Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cakephp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2014-08-24T17:35:29.000Z","updated_at":"2025-11-03T02:08:18.000Z","dependencies_parsed_at":"2023-01-13T20:43:51.159Z","dependency_job_id":"ccef19a8-f3c7-44d4-ab47-37ce7d29d49a","html_url":"https://github.com/cakephp/event","commit_stats":{"total_commits":212,"total_committers":36,"mean_commits":5.888888888888889,"dds":0.7688679245283019,"last_synced_commit":"5ae4038a13c3a6884e05c6399e0fc379bbee9845"},"previous_names":[],"tags_count":320,"template":false,"template_full_name":null,"purl":"pkg:github/cakephp/event","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cakephp%2Fevent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cakephp%2Fevent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cakephp%2Fevent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cakephp%2Fevent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cakephp","download_url":"https://codeload.github.com/cakephp/event/tar.gz/refs/heads/5.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cakephp%2Fevent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31313235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-08-01T21:01:29.859Z","updated_at":"2026-04-02T18:43:41.431Z","avatar_url":"https://github.com/cakephp.png","language":"PHP","readme":"[![Total Downloads](https://img.shields.io/packagist/dt/cakephp/event.svg?style=flat-square)](https://packagist.org/packages/cakephp/event)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LICENSE.txt)\n\n# CakePHP Event Library\n\nThis library emulates several aspects of how events are triggered and managed in popular JavaScript\nlibraries such as jQuery: An event object is dispatched to all listeners. The event object holds information\nabout the event, and provides the ability to stop event propagation at any point.\nListeners can register themselves or can delegate this task to other objects and have the chance to alter the\nstate and the event itself for the rest of the callbacks.\n\n## Usage\n\nListeners need to be registered into a manager and events can then be triggered so that listeners can be informed\nof the action.\n\n```php\nuse Cake\\Event\\Event;\nuse Cake\\Event\\EventDispatcherTrait;\n\nclass Orders\n{\n\n\tuse EventDispatcherTrait;\n\n\tpublic function placeOrder($order)\n\t{\n\t\t$this-\u003edoStuff();\n\t\t$event = new Event('Orders.afterPlace', $this, [\n\t\t\t'order' =\u003e $order\n\t\t]);\n\t\t$this-\u003egetEventManager()-\u003edispatch($event);\n\t}\n}\n\n$orders = new Orders();\n$orders-\u003egetEventManager()-\u003eon(function ($event) {\n\t// Do something after the order was placed\n\t...\n}, 'Orders.afterPlace');\n\n$orders-\u003eplaceOrder($order);\n```\n\nThe above code allows you to easily notify the other parts of the application that an order has been created.\nYou can then do tasks like send email notifications, update stock, log relevant statistics and other tasks\nin separate objects that focus on those concerns.\n\n## Documentation\n\nPlease make sure you check the [official documentation](https://book.cakephp.org/5/en/core-libraries/events.html)\n","funding_links":[],"categories":["Table of Contents","目录","PHP","事件 Event","事件( Event )"],"sub_categories":["Event","事件 Event"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcakephp%2Fevent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcakephp%2Fevent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcakephp%2Fevent/lists"}