{"id":41214965,"url":"https://github.com/phore/phore-micro-app","last_synced_at":"2026-01-22T23:58:44.736Z","repository":{"id":57039229,"uuid":"136929053","full_name":"phore/phore-micro-app","owner":"phore","description":"Micro Web Framework","archived":false,"fork":false,"pushed_at":"2021-02-28T18:41:43.000Z","size":146,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-02T17:54:23.894Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://infracamp.org/project/phore/","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/phore.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-06-11T13:19:09.000Z","updated_at":"2021-02-28T18:41:17.000Z","dependencies_parsed_at":"2022-08-23T23:31:02.735Z","dependency_job_id":null,"html_url":"https://github.com/phore/phore-micro-app","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/phore/phore-micro-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phore%2Fphore-micro-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phore%2Fphore-micro-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phore%2Fphore-micro-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phore%2Fphore-micro-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phore","download_url":"https://codeload.github.com/phore/phore-micro-app/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phore%2Fphore-micro-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28675278,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T20:48:19.482Z","status":"ssl_error","status_checked_at":"2026-01-22T20:48:14.968Z","response_time":144,"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":"2026-01-22T23:58:44.067Z","updated_at":"2026-01-22T23:58:44.730Z","avatar_url":"https://github.com/phore.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Minimalistic Microservice Framework\n\nThis documentation is written along the guidelines of educational grade documentation discussed in the \n[infracamp](https://github.com/infracamp/infracamp/blob/master/DOCUMENTATION_GUIDE.md) project. Please ask and\ndocument issues.\n\n## Goals\n\n- Minimal Footprint\n- No external dependencies\n- Clear and small stack trace\n- Fluent Api\n- Role-Based Authentication\n\nQuicklinks\n- Assets\n- Authentication\n- Session\n- OAuth\n- Firewall ACL\n\n## Naming conventions\n\nClasses for micro-app and libraries are **not** prefixed with `phore_` for convenience.\n(It's not framework for framework stuff)\n\n## Quickstart\n\n```index.php:```\n```php\n$app = new App();\n\n$app-\u003erouter\n    -\u003eonGet(\"/\",                                              // Define a Action for HTTP-GET-Requests to /\n        function() {                             \n            return \"Hello world\";                             // Important: Return true if output was already sent.\n        }\n    );\n    \n$app-\u003eserve();                                                // Run the App\n```\n\n## Installation\n\nWe suggest using [composer](http://getcomposer.com):\n\n```\ncomposer require phore/micro-app\n``` \n\n\n## [Routing](docs/router/routing.md) *([Example](docs/router/routing-example.php))*\n\nDefine routes (Path) and connect them to controller functions:\n\n- Execute the function if the browser hits `http://domain.xy/hello/world`:\n  ```php\n  $app-\u003erouter-\u003eonGet(\"/hello/world\", function() {\n      echo \"Hello World\";\n      return true; \n  });\n  ```\n  \n- Define Parameters (Prefix `:`) and optional parameters (`?`) in Routes:\n  ```php\n  $app-\u003erouter-\u003eonGet(\"/api/create/:userId/:userName?\", function(RouteParams $routeParams) {\n      echo \"Hello {$routeParams-\u003eget(\"userId\")} - {$routeParams-\u003eget(\"userName\", 'Default Username')}\";\n      return true;\n  });\n  ```\n  *`$routeParams`* is automaticly generated by Dependency injection.\n  \n- Delegate a request to a separate class: [see Example](doc/router/routing-delegate-example.php)\n  ```php\n  $app-\u003erouter-\u003edelegate(\"/admin/*\", AdminController::class);\n  ```\n\n- Add a controller Class:\n  ```php\n  class ActionCtrl {\n      const ROUTE = \"/v1/some/route\"\n      public function on_get(){} \n  }\n  $app-\u003eaddCtrl(ActionCtrl::class);\n  ```\n\n\nParameters at controller function are generated by Dependency Injection\nand may contain any service defined in DiContainer.\n\nRequest specific parameters are:\n\n| Parameter Name | ClassName        | Description                   |\n|----------------|------------------|-------------------------------|\n| `$request`     | `Request`        | The full request object       |\n| `$post`        | `Post`           | Post data                     |\n| `$get`         | `Get`           | Get data (Query Params)       |\n| `$body`        | `Body`           | Body object                   |\n| `$files`       | `Files`          ||\n||\n| `$route`       | `Route`          | The current route object      |\n| `$params`      | `Params`         | Container with QueryParameters|\n| `$routeParams` | `RouteParams`    | Container with parameters     |\n| `$GET`         | `QueryParams`    | Query parameters              |\n| `$POST`        | `QueryParams`    | Parameters send by HTTP-POST  |\n\n\n\n## Dependency Injection\n\nThe app-class is a dependency injection container. You can register\nvalues or services using the `define()` method.\n\n- Define a value to property `version`:\n  ```php\n  $app-\u003edefine(\"version\", new DiValue(\"1.0.1\"));\n  echo $app-\u003eversion;\n  ```\n  \n- Define a factory to property `configFile`:\n  ```php\n  $app-\u003edefine(\"configFile\", new DiService(function() {\n      return file_get_contents(\"config-file.json\") \n  });\n  echo $app-\u003econfigFile;\n  ```\n\n## Error Handling\n\nThe system has build-in functions for error-handling:\n\n- Activate `json` error/exception handling:\n  ```\n  $app-\u003esetOnExceptionHandler(new JsonExceptionHandler());\n  ```\n\n## API Usage: Default Result Handler\n\nInstead of formating the Result your own, the framework uses a\nresult-handler to format results returned by `return` in controller.\n\n```\n$app-\u003esetDefaultResultHandler(new JsonResultHandler());\n```\n\nin the controller you can then just return the data:\n\n```php\n$app-\u003eget(\"/\", function() {\n    return [\"data\"=\u003e\"someData\"];\n}\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphore%2Fphore-micro-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphore%2Fphore-micro-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphore%2Fphore-micro-app/lists"}