{"id":24247120,"url":"https://github.com/manifestwebdesign/php-hooks","last_synced_at":"2025-08-02T00:08:39.346Z","repository":{"id":7183864,"uuid":"8486482","full_name":"ManifestWebDesign/PHP-Hooks","owner":"ManifestWebDesign","description":"Hook / Event helper library for PHP","archived":false,"fork":false,"pushed_at":"2013-02-28T20:01:04.000Z","size":108,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-03T00:05:11.784Z","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/ManifestWebDesign.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":"2013-02-28T19:37:13.000Z","updated_at":"2022-06-09T19:30:29.000Z","dependencies_parsed_at":"2022-09-16T05:01:42.034Z","dependency_job_id":null,"html_url":"https://github.com/ManifestWebDesign/PHP-Hooks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ManifestWebDesign/PHP-Hooks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManifestWebDesign%2FPHP-Hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManifestWebDesign%2FPHP-Hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManifestWebDesign%2FPHP-Hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManifestWebDesign%2FPHP-Hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ManifestWebDesign","download_url":"https://codeload.github.com/ManifestWebDesign/PHP-Hooks/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManifestWebDesign%2FPHP-Hooks/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268315948,"owners_count":24231059,"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-08-01T02:00:08.611Z","response_time":67,"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":"2025-01-14T23:18:14.463Z","updated_at":"2025-08-02T00:08:39.273Z","avatar_url":"https://github.com/ManifestWebDesign.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"PHP-Hooks\n=========\nStandalone Hook / Event helper library for PHP\n\n\nBasic Usage:\n------------\n```php\nHook::add('my_hook', function($message){\n  echo $message;\n});\nHook::call('my_hook', 'Hello world');  // echo 'Hello world'\n```\n\nRemoving a Single Callback from a Hook:\n---------------------------------------\nHook internally creates unique ids for callbacks, so they can be removed\n```php\n$callback = function($message){\n  echo $message;\n};\nHook::add('my_hook', $callback);\nHook::call('my_hook', 'Hello world');  // echo 'Hello world'\nHook::remove('my_hook', $callback);\nHook::call('my_hook', 'Hello world'); // does nothing\n```\n\nRemoving all Callbacks for a Hook:\n----------------------------------\n```php\nHook::add('my_hook', function($message){\n  echo $message;\n});\nHook::remove('my_hook');\nHook::call('my_hook', 'Hello world'); // does nothing\n```\n\nPriority and Return False\n----------------------------------\n```php\nHook::add('my_hook', function($message){\n  echo $message;\n}, 100); // priority of 100\nHook::add('my_hook', function(){\n  return false;\n}, 99);\nHook::call('my_hook', 'Hello world'); // does nothing, because the callback that returned false was executed first\n```\n\nGet Array of Registered Callbacks for a Hook\n--------------------------------------------\n```php\nHook::add('my_hook', function($message){\n  echo $message;\n}, 100); // priority of 100\nHook::add('my_hook', function(){\n  return false;\n}, 99);\nHook::get('my_hook'); // returns numeric array with both callbacks, in the order that they would execute\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanifestwebdesign%2Fphp-hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanifestwebdesign%2Fphp-hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanifestwebdesign%2Fphp-hooks/lists"}