{"id":37014542,"url":"https://github.com/fabiomontefuscolo/php-mediator","last_synced_at":"2026-01-14T01:27:04.365Z","repository":{"id":57019525,"uuid":"133562735","full_name":"fabiomontefuscolo/php-mediator","owner":"fabiomontefuscolo","description":"A simple hooks system","archived":true,"fork":false,"pushed_at":"2018-05-16T02:37:03.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-27T15:30:47.925Z","etag":null,"topics":["actions","filters","hooks","mediator","php"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fabiomontefuscolo.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":"2018-05-15T19:20:14.000Z","updated_at":"2023-01-28T04:42:11.000Z","dependencies_parsed_at":"2022-08-22T20:31:16.077Z","dependency_job_id":null,"html_url":"https://github.com/fabiomontefuscolo/php-mediator","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/fabiomontefuscolo/php-mediator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiomontefuscolo%2Fphp-mediator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiomontefuscolo%2Fphp-mediator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiomontefuscolo%2Fphp-mediator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiomontefuscolo%2Fphp-mediator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabiomontefuscolo","download_url":"https://codeload.github.com/fabiomontefuscolo/php-mediator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiomontefuscolo%2Fphp-mediator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28407742,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","response_time":56,"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":["actions","filters","hooks","mediator","php"],"created_at":"2026-01-14T01:27:03.664Z","updated_at":"2026-01-14T01:27:04.350Z","avatar_url":"https://github.com/fabiomontefuscolo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-mediator [![Build Status](https://travis-ci.org/fabiomontefuscolo/php-mediator.svg?branch=master)](https://travis-ci.org/fabiomontefuscolo/php-mediator)\n\nIt is just another Hook system. It is useful to integrate very distinct components of software without making them too coupled to each other.\n\n\n## Installing\n\n```shell\ncomposer require montefuscolo/php-mediator\n```\n\n\n## Using it\n\n### Actions\n\n```php\n\u003c?php\nuse montefuscolo/BaseMediator;\n\n$mediator = new BaseMediator();\n\n// Add callbacks to be called later\n$mediator-\u003eadd_action('my-channel', function() {\n    echo 'Hello World' . PHP_EOL;\n});\n$mediator-\u003eadd_action('my-channel', function() {\n    echo 'Foo Bar' . PHP_EOL;\n});\n\n// .... \n\n$mediator-\u003erun_actions('my-channel');\n```\n\n\n### Filters\n\n```php\n\u003c?php\nuse montefuscolo/BaseMediator;\n\n$mediator = new BaseMediator();\n\n// Add callbacks to be called later\n$mediator-\u003eadd_filter('my-channel', function($n) {\n    return $n * 2;\n});\n$mediator-\u003eadd_filter('my-channel', function($n) {\n    return $n * 3;\n});\n$mediator-\u003eadd_filter('my-channel', function($n) {\n    return $n - 6;\n});\n\n// .... \n\necho $mediator-\u003erun_filters('my-channel', 1);\n// \u003e\u003e\u003e 0\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiomontefuscolo%2Fphp-mediator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabiomontefuscolo%2Fphp-mediator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiomontefuscolo%2Fphp-mediator/lists"}