承接 oscarotero/fol 相关项目开发

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

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

oscarotero/fol

最新稳定版本:v1.0.1

Composer 安装命令:

composer require oscarotero/fol

包简介

Base App class to build websites

关键字:

README 文档

README

Latest Version on Packagist Software License Build Status Quality Score

This is a simple class with some utils to build websites with the following features:

Paths and URI

Manage the path of the app and the public uri using the UriInterface from PSR-7:

use Fol\App;
use Zend\Diactoros\Uri;

$path = '/var/www/my-website';
$uri = new Uri('http://localhost/my-website');

$app = new App($path, $uri);

//Get the path
$app->getPath(); // /var/www/my-website
$app->getPath('dir/subdir', '../other'); // /var/www/my-website/dir/other

//Get the uri
(string) $app->getUri(); // http://localhost/my-website
(string) $app->getUri('post/1', 'details'); // http://localhost/my-website/post/1/details

PSR-11

It's compatible with PSR-11 and container-interop/service-provider, and allows to nest other containers:

use Fol\App;
use Zend\Diactoros\Uri;

$app = new App(__DIR__, new Uri('http://localhost/my-website'));

//Set a value
$app->set('database.config', [
    'user' => 'foo',
    'pass' => 'bar'
]);

//Get the value
$config = $app->get('database.config');

//Set a service
$app->addService('database', function ($app) {
    return new DatabaseClass($app->get('database.config'));
});

//Get the service value
$database = $app->get('database');

//And add ServiceProviderInterface instances to register several dependencies
$app->addServiceProvider(new MyServiceProvider());

Please see CHANGELOG for more information about recent changes.

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-01-07