承接 blast/application 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

blast/application

最新稳定版本:v1.0

Composer 安装命令:

composer require blast/application

包简介

The framework agnostic application life-cycle

README 文档

README

Latest Version on Packagist Software License Build Status Total Downloads Coverage Status

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

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

Install

Via Composer

$ composer require blast/application

Usage

Lets build our first base application.

The foundation

<?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.

Application configuration is an Array and just need to passed to our config.

We could pass directly:

<?php

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

Or receive config data from anywhere

<?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

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.

We use league/container for example.

<?php

use League\Container;

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

Here is an list of container-interop implementations.

Dispatching

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

For example we use wellrested/wellrested for our PSR-7 implementation.

<?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:

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

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

Security

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

Credits

License

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

统计信息

  • 总下载量: 46
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-11-06