{"id":20846642,"url":"https://github.com/yohn/plugable","last_synced_at":"2026-03-01T09:34:28.213Z","repository":{"id":253591719,"uuid":"843962136","full_name":"Yohn/Plugable","owner":"Yohn","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-18T00:25:52.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-24T20:11:30.652Z","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/Yohn.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-18T00:23:45.000Z","updated_at":"2024-08-18T00:23:51.000Z","dependencies_parsed_at":"2024-08-18T01:20:43.287Z","dependency_job_id":null,"html_url":"https://github.com/Yohn/Plugable","commit_stats":null,"previous_names":["yohn/plugable"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Yohn/Plugable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yohn%2FPlugable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yohn%2FPlugable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yohn%2FPlugable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yohn%2FPlugable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yohn","download_url":"https://codeload.github.com/Yohn/Plugable/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yohn%2FPlugable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29965679,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T09:33:09.965Z","status":"ssl_error","status_checked_at":"2026-03-01T09:25:48.915Z","response_time":124,"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-11-18T02:17:15.866Z","updated_at":"2026-03-01T09:34:28.195Z","avatar_url":"https://github.com/Yohn.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yohns\\Core\\Plugable\n\n```php\n\u003c?php\nuse Yohns\\Core\\Plugable;\n\n// Define the plugin directory\n$pluginDir = __DIR__.'/pluggable/plugins/';\n\n// Define the plugins to load\n$plugins = ['Events', 'News', 'Pictures'];\n\n// Load the plugins with the directory variable\n$loadedPlugins = Plugable::loadPlugins($plugins, $pluginDir);\n\necho \"\u003cpre\u003eLoaded Plugins:\\n\";\nprint_r($loadedPlugins);\necho \"\u003c/pre\u003e\";\n\n// Add hooks\nPlugable::addHook('startup', function() {\n\techo \"Startup hook executed!\u003cbr\u003e\";\n});\n\nPlugable::addHook('shutdown', function() {\n\techo \"Shutdown hook executed!\u003cbr\u003e\";\n});\n\n// Execute the 'startup' event hooks\nPlugable::doHook('startup');\n\n// Add a filter\nPlugable::addFilter('content_filter', ['content' =\u003e 'Original content']);\n\n// Execute the filter for 'content_filter'\n$result = Plugable::doFilter('content_filter', function(array $data) {\n\t// Modify the filtered data\n\t$data[0]['content'] = 'Filtered content';\n\treturn $data;\n});\n\necho \"\u003cpre\u003eFiltered Data:\\n\";\nprint_r($result);\necho \"\u003c/pre\u003e\";\n\n// Execute the 'shutdown' event hooks\nPlugable::doHook('shutdown');\n\n```\n\n```php\n//--   loading plugins\nforeach ($loadedPlugins as $k =\u003e $v) {\n\tif ($v['IncludeFiles'] != '') {\n\t\tif (is_array($v['IncludeFiles'])) {\n\t\t\tforeach ($v['IncludeFiles'] as $fi) {\n\t\t\t\tif (is_file($pluginDir . $k . '/' . $fi)) {\n\t\t\t\t\tinclude ($pluginDir . $k . '/' . $fi);\n\t\t\t\t} else {\n\t\t\t\t\tdie($pluginDir . $k . '/' . $fi . ' file was not found');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif ($v['Route'] != '') {\n\t\t$Routes[] = $v['Route'];\n\t}\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyohn%2Fplugable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyohn%2Fplugable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyohn%2Fplugable/lists"}