2017 © Pedro Peláez
 

library application

The framework agnostic application life-cycle

image

blast/application

The framework agnostic application life-cycle

  • Monday, January 25, 2016
  • by mbunge
  • Repository
  • 1 Watchers
  • 1 Stars
  • 33 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Blast application

Latest Version on Packagist ![Software License][ico-license] Build Status ![Total Downloads][ico-downloads] Coverage Status, (*1)

The goal of Blast application is to deliver a framework agnostic application life-cycle having regard on modern standards., (*2)

PSR-0, PSR-1, PSR-2, PSR-3, PSR-4, PSR-7, PSR-11 (Container-interop) are supported standards., (*3)

Install

Via Composer, (*4)

``` bash $ composer require blast/application, (*5)


## Usage Lets build our first base application. ### The foundation ```php <?php use Blast\Application\Kernel\Foundation as Application $application = new Application();

Configuration

Our application foundation has been set, now we are able to set our config., (*6)

Application configuration is an Array and just need to passed to our config., (*7)

We could pass directly:, (*8)

<?php

$application->setConfig([
  'name' => 'base application'
]);

Or receive config data from anywhere, (*9)

<?php

//should return an array!
$config = require_once __DIR__ . '/config.php';
$application->setConfig($config);

You are free to choose how to pass configuration. You could also use packages like, (*10)

Container

Modern application needs to decouple complexity. That means we want to manage services and inject them automatically. Blast application is following the standard of container-interop/container-interop., (*11)

We use league/container for example., (*12)

<?php

use League\Container;

$application->setContainer(new Container());

Here is an list of container-interop implementations., (*13)

Dispatching

Our application is dispatching an added strategy with an PSR-7 request and response. Within this strategy you could define your own logic., (*14)

For example we use wellrested/wellrested for our PSR-7 implementation., (*15)

<?php

use WellRESTed\Message\Response;
use WellRESTed\Message\ServerRequest;
use Acme\Strategy;

$application->setStrategy(new Strategy);
$application->dispatch(ServerRequest::getServerRequest(), new Response);

Their are more PSR-7 compatible packages available on packagist or the following:, (*16)

  • symfony/http-foundation with symfony/psr-http-message-bridge

Change log

Please see CHANGELOG for more information what has changed recently., (*17)

Testing

bash $ composer test, (*18)

Contributing

Please see CONTRIBUTING for details., (*19)

Security

If you discover any security related issues, please email :author_email instead of using the issue tracker., (*20)

Credits

License

The MIT License (MIT). Please see License File for more information., (*21)

The Versions

25/01 2016

dev-master

9999999-dev

The framework agnostic application life-cycle

  Sources   Download

MIT

The Requires

 

The Development Requires

psr-7 framework container http application container-interop blast agnostic web-application

06/11 2015

v1.0

1.0.0.0

The framework agnostic application life-cycle

  Sources   Download

MIT

The Requires

 

The Development Requires

psr-7 framework container http application container-interop blast agnostic web-application

06/11 2015

dev-1.x-dev

dev-1.x-dev

The framework agnostic application life-cycle

  Sources   Download

MIT

The Requires

 

The Development Requires

psr-7 framework container http application container-interop blast agnostic web-application

29/10 2015