{"id":19952021,"url":"https://github.com/studio24/pubsub","last_synced_at":"2026-04-15T16:33:13.086Z","repository":{"id":57060546,"uuid":"54898367","full_name":"studio24/pubsub","owner":"studio24","description":"Simple implementation of the PubSub design pattern in PHP","archived":false,"fork":false,"pushed_at":"2016-08-16T22:18:26.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-05T05:06:00.165Z","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/studio24.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-28T14:33:02.000Z","updated_at":"2016-03-28T14:33:36.000Z","dependencies_parsed_at":"2022-08-24T14:53:32.545Z","dependency_job_id":null,"html_url":"https://github.com/studio24/pubsub","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/studio24/pubsub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studio24%2Fpubsub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studio24%2Fpubsub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studio24%2Fpubsub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studio24%2Fpubsub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/studio24","download_url":"https://codeload.github.com/studio24/pubsub/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studio24%2Fpubsub/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31849801,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: 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-11-13T01:11:14.389Z","updated_at":"2026-04-15T16:33:13.070Z","avatar_url":"https://github.com/studio24.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PubSub\n\nSimple implementation of the PubSub design pattern in PHP.\n\n## Installation\n\n```sh\ncomposer require studio24/pubsub\n```\n\n## Usage\n\nImport at the top of your PHP script via:\n\n```sh\nuse Studio24\\PubSub\\PubSub;\n```\n\n### Add a task to run at a certain event (subscribe)\n\nThis will run the passed anonymous function when the event 'myevent' is run.\n\n```sh\nPubSub::subscribe('myevent', function($name){\n    // My code goes here\n    echo $name;\n});\n```\n\n#### PubSub::subscribe($event, $callback, $weight)\n\nParams:\n\n* $event (string) Event name \n* $callback (callback) Callback function to run \n* $weight (int) Optional, weight to define the order subscribed tasks run, defaults to 10. The lower the number the earlier this callback runs\n\n### Run tasks at a certain event (publish)\n\nThis runs all tasks which are subscribed to the 'myevent' event, passing the argument $name. \n\n```sh\nPubSub::publish('myevent', $name);\n```\n\n#### PubSub::publish($event, ...$arguments)\n\nParams:\n\n* $event (string) Event name \n* $arguments (mixed) Optional, one or many arguments to pass to the callback function \n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n## Credits\n\n- [Simon R Jones](https://github.com/simonrjones)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstudio24%2Fpubsub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstudio24%2Fpubsub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstudio24%2Fpubsub/lists"}