承接 rch/config-access-bundle 相关项目开发

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

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

rch/config-access-bundle

Composer 安装命令:

composer require rch/config-access-bundle

包简介

Get/set your application config values using dot paths.

README 文档

README

Build Status StyleCI SensioLabsInsight

Retrieve final configuration values from any container-aware context.

Why?

In Symfony, when you need to get the value of any configuration (default in app/config) the answer is always parameters.

But, what about the final configuration? After that the DI container has been compiled? After that compiler passes and bundle extensions changed it or merged it with a default one?

Actuall there is no solution excepted processing the whole configuration of a bundle each time you need it, even partially. This bundle is intended to solve this problem.

Related issues:

Installation

Download the bundle

$ composer require rch/config-access-bundle

This command requires you to have Composer installed globally.

Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php file of your project:

// app/AppKernel.php

$bundles = array(
    // ...
    new RCH\ConfigAccessBundle\RCHConfigAccessBundle(),
);

Usage

Get configuration values

<?php

$accessor = $this->container->get('rch.config_access.accessor');

$accessor->get('security');
// array('encoders' => array(...), 'providers' => array(...), ...)

$accessor->get('framework.serializer');
// array('enabled' => true, ...)

$accessor->get('framework.serializer.enabled');
// true

$accessor->get('stof_doctrine_extensions.uploadable');
// array('orm' => array(...), 'uploadable' => array(...), ...)

$accessor->get('lexik_jwt_authentication.encoder.service'); 
// 'lexik_jwt_authentication.encoder.default'

$accessor->get('frameorf.default_locale'); 
$accessor->get('framework.default_loal');

// Did you mean "framework.default_locale"?

Inject them into your services

services:
    foo_manager:
        arguments: 
            - '@=service("rch_config_access.accessor").get("security")'
<?php

namespace AppBundle\Services;

class FooManager 
{
    public function __construct(array $security)
    {
        $this->security = $security;
    }
    
    // ...
}

Contributing

Guidelines

License

The code is released under the MIT license.

For the whole copyright, see the distributed LICENSE file.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-06-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固