{"id":20321319,"url":"https://github.com/notrab/dumbo","last_synced_at":"2025-05-15T14:05:49.618Z","repository":{"id":248521966,"uuid":"828962720","full_name":"notrab/dumbo","owner":"notrab","description":"A lightweight, friendly PHP framework for HTTP.","archived":false,"fork":false,"pushed_at":"2025-05-02T10:45:16.000Z","size":513,"stargazers_count":307,"open_issues_count":13,"forks_count":22,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-07T23:08:30.703Z","etag":null,"topics":["dumbo","micro-framework","php"],"latest_commit_sha":null,"homepage":"","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/notrab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["notrab"]}},"created_at":"2024-07-15T13:28:40.000Z","updated_at":"2025-05-01T02:07:36.000Z","dependencies_parsed_at":"2024-08-14T21:30:37.309Z","dependency_job_id":"6bcd6a23-8cae-4db5-9b51-7c45560413dc","html_url":"https://github.com/notrab/dumbo","commit_stats":{"total_commits":116,"total_committers":12,"mean_commits":9.666666666666666,"dds":0.3017241379310345,"last_synced_commit":"19819ca8d12a4d54048ad2f9cbb6afcf4b7460fa"},"previous_names":["notrab/dumbo"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notrab%2Fdumbo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notrab%2Fdumbo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notrab%2Fdumbo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notrab%2Fdumbo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/notrab","download_url":"https://codeload.github.com/notrab/dumbo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254355334,"owners_count":22057354,"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","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":["dumbo","micro-framework","php"],"created_at":"2024-11-14T19:13:35.595Z","updated_at":"2025-05-15T14:05:44.608Z","avatar_url":"https://github.com/notrab.png","language":"PHP","funding_links":["https://github.com/sponsors/notrab"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"dumbo.jpeg\" alt=\"Dumbo\" width=\"600\"/\u003e\n  \u003ch1 align=\"center\"\u003eDumbo\u003c/h1\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  A lightweight, friendly PHP framework for HTTP \u0026mdash; Inspired by Hono.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://discord.gg/nAq2h9BfsU\"\u003e\n    \u003cpicture\u003e\n      \u003cimg src=\"https://img.shields.io/discord/1278637768918171709?color=8A2BE2\" alt=\"Discord\" /\u003e\n    \u003c/picture\u003e\n  \u003c/a\u003e\n  \u003cpicture\u003e\n    \u003cimg src=\"https://img.shields.io/github/contributors/notrab/dumbo?color=8A2BE2\" alt=\"Contributors\" /\u003e\n  \u003c/picture\u003e\n  \u003ca href=\"https://packagist.org/packages/notrab/dumbo\"\u003e\n    \u003cpicture\u003e\n      \u003cimg src=\"https://img.shields.io/packagist/dt/notrab/dumbo?color=8A2BE2\" alt=\"Total downloads\" /\u003e\n    \u003c/picture\u003e\n  \u003c/a\u003e\n  \u003ca href=\"/examples\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/browse-examples-8A2BE2\" alt=\"Examples\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Features\n\n- 🚀 Lightweight and fast\n- 🧩 Middleware support\n- 🛣️ Flexible routing with parameters\n- 🔒 Built-in security features (CSRF, JWT)\n- 🍪 Cookie management\n- 📅 Date helpers\n- 🔍 Request ID for tracing\n- 📁 Static file serving\n- 🔐 Basic and Bearer authentication\n- 📝 Logging support\n- 🗃️ HTTP caching\n- 🔄 CORS support\n- 🧬 Environment-based configuration\n\n## Install\n\n```bash\ncomposer require notrab/dumbo\n```\n\n## Quickstart\n\nHere's a basic example of how it works!\n\n```php\n\u003c?php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse Dumbo\\Dumbo;\n\n$app = new Dumbo();\n\n$app-\u003euse(function ($context, $next) {\n    $context-\u003eset('message', 'Hello from middleware!');\n    return $next($context);\n});\n\n$app-\u003eget('/', function ($context) {\n    return $context-\u003ejson([\n        'message' =\u003e $context-\u003eget('message'),\n        'timestamp' =\u003e time()\n    ]);\n});\n\n$app-\u003eget('/users/:id', function ($context) {\n    $id = $context-\u003ereq-\u003eparam('id');\n    return $context-\u003ejson(['userId' =\u003e $id]);\n});\n\n$app-\u003epost('/users', function ($context) {\n    $body = $context-\u003ereq-\u003ebody();\n    return $context-\u003ejson($body, 201);\n});\n\n$app-\u003erun();\n```\n\nSee the [examples](/examples) directory for more quickstarts.\n\n## License\n\nDumbo is open-sourced software licensed under the [MIT license](LICENSE).\n\n## Contributors\n\n![Contributors](https://contrib.nn.ci/api?repo=notrab/dumbo)\n\n## Documentation\n\n### Routing\n\n```php\n\u003c?php\n\n$app-\u003eget('/users', function($context) { /* ... */ });\n$app-\u003epost('/users', function($context) { /* ... */ });\n$app-\u003eput('/users/:id', function($context) { /* ... */ });\n$app-\u003edelete('/users/:id', function($context) { /* ... */ });\n```\n\n#### Params\n\n```php\n\u003c?php\n\n$app-\u003eget('/users/:id', function($context) {\n    $id = $context-\u003ereq-\u003eparam('id');\n\n    return $context-\u003ejson(['id' =\u003e $id]);\n});\n```\n\n#### Nested\n\n```php\n\u003c?php\n\n$nestedApp = new Dumbo();\n\n$nestedApp-\u003eget('/nested', function($context) {\n    return $context-\u003etext('This is a nested route');\n});\n\n$app-\u003eroute('/prefix', $nestedApp);\n\n```\n\n### Context\n\n```php\n\u003c?php\n\n$app-\u003eget('/', function($context) {\n    $pathname = $context-\u003ereq-\u003epathname();\n    $routePath = $context-\u003ereq-\u003eroutePath();\n    $queryParam = $context-\u003ereq-\u003equery('param');\n    $tags = $context-\u003ereq-\u003equeries('tags');\n    $body = $context-\u003ereq-\u003ebody();\n    $userAgent = $context-\u003ereq-\u003eheader('User-Agent');\n});\n```\n\n### Response\n\n```php\n\u003c?php\n\nreturn $context-\u003ejson(['key' =\u003e 'value']);\nreturn $context-\u003etext('Hello, World!');\nreturn $context-\u003ehtml('\u003ch1\u003eHello, World!\u003c/h1\u003e');\nreturn $context-\u003eredirect('/new-url');\n```\n\n### Middleware\n\n```php\n\u003c?php\n\n$app-\u003euse(function($context, $next) {\n    $response = $next($context);\n\n    return $response;\n});\n```\n\n### Custom context\n\n```php\n\u003c?php\n\n$app = new Dumbo();\n\n// Set configuration values\n$app-\u003eset('DB_URL', 'mysql://user:pass@localhost/mydb');\n$app-\u003eset('API_KEY', 'your-secret-key');\n$app-\u003eset('DEBUG', true);\n\n// Get configuration values\n$dbUrl = $app-\u003eget('DB_URL');\n$apiKey = $app-\u003eget('API_KEY');\n$debug = $app-\u003eget('DEBUG');\n\n// Use configuration in your routes\n$app-\u003eget('/api/data', function(Context $context) {\n    $apiKey = $context-\u003eget('API_KEY');\n\n    // Use $apiKey in your logic...\n    return $context-\u003ejson(['message' =\u003e 'API key is set']);\n});\n\n$app-\u003erun();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotrab%2Fdumbo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotrab%2Fdumbo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotrab%2Fdumbo/lists"}