Download the PHP package phore/micro-app without Composer
On this page you can find all versions of the php package phore/micro-app. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phore/micro-app
More information about phore/micro-app
Files in phore/micro-app
Package micro-app
Short Description Micro framework for rest api webservices
License MIT
Homepage https://infracamp.org/phore/
Informations about the package micro-app
Minimalistic Microservice Framework
This documentation is written along the guidelines of educational grade documentation discussed in the infracamp project. Please ask and document issues.
Goals
- Minimal Footprint
- No external dependencies
- Clear and small stack trace
- Fluent Api
- Role-Based Authentication
Quicklinks
- Assets
- Authentication
- Session
- OAuth
- Firewall ACL
Naming conventions
Classes for micro-app and libraries are not prefixed with phore_
for convenience.
(It's not framework for framework stuff)
Quickstart
Installation
We suggest using composer:
Example)
Define routes (Path) and connect them to controller functions:
-
Execute the function if the browser hits
http://domain.xy/hello/world
: -
Define Parameters (Prefix
:
) and optional parameters (?
) in Routes:$routeParams
is automaticly generated by Dependency injection. -
Delegate a request to a separate class: see Example
- Add a controller Class:
Parameters at controller function are generated by Dependency Injection and may contain any service defined in DiContainer.
Request specific parameters are:
Parameter Name | ClassName | Description |
---|---|---|
$request |
Request |
The full request object |
$post |
Post |
Post data |
$get |
Get |
Get data (Query Params) |
$body |
Body |
Body object |
$files |
Files |
|
$route |
Route |
The current route object |
$params |
Params |
Container with QueryParameters |
$routeParams |
RouteParams |
Container with parameters |
$GET |
QueryParams |
Query parameters |
$POST |
QueryParams |
Parameters send by HTTP-POST |
Dependency Injection
The app-class is a dependency injection container. You can register
values or services using the define()
method.
-
Define a value to property
version
: - Define a factory to property
configFile
:
Error Handling
The system has build-in functions for error-handling:
- Activate
json
error/exception handling:
API Usage: Default Result Handler
Instead of formating the Result your own, the framework uses a
result-handler to format results returned by return
in controller.
in the controller you can then just return the data:
All versions of micro-app with dependencies
phore/di-base Version ^2.2.1
psr/log Version ^1.1
phore/core Version *
ext-json Version *
ext-yaml Version *