Fabric provides the structures, prerequisites and conventions for building a web application using the DecodeLabs ecosystem.
Install via Composer:
composer require decodelabs/fabric
A Fabric app looks very similar to a standard package with most code residing in the src folder, under a namespace of your choice and loaded via composer.
Fabric uses Genesis
for bootstrapping your application. Add the DecodeLabs\Fabric\Genesis\Hub
class to your composer.json
file:
{
"extra": {
"genesis": {
"hub": "DecodeLabs\\Fabric\\Genesis\\Hub"
}
}
}
Then point your HTTP server to rewite to vendor/genesis.php
as your entry point. Genesis takes care of the rest.
Fabric utilises Dovetail
for config loading - via a private .env file in the app root and data files in /config (though this can be customised if necessary).
The most important config file is the Environment.php
file which defines some key values for the rest of the app to initialize with.
The appNamespace value will allow you to define the namespace in which the majority of your app code will reside, and which is already defined for loading in your composer file.
Coming soon
Fabric provides solid HTTP and CLI kernels that can handle requests in both contexts. Clip
is used for CLI tasks, and Harvest
for HTTP.
The HTTP kernel uses an extensible set of Middlewares to provide a flexible request handling pipeline. The default implementation is provided by Harvest
and is a good starting point for most apps.
Greenleaf is used for routing and provides a simple, flexible and powerful routing system for HTTP Actions.
Fabric is licensed under the MIT License. See LICENSE for the full license text.