carlosv2/allegro 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

carlosv2/allegro

Composer 安装命令:

composer require carlosv2/allegro

包简介

Symfony bundles autoloader

README 文档

README

Symfony bundles autoloader.

License Build Status SensioLabsInsight

Why

How many times have you required a composer package for your Symfony project and then you have needed to add it into AppKernel?

For some projects, there is not an straight correlation but for most of them, the only reason to require them is to add the bundle from within to a Symfony project.

For those cases, this project tries to minimise the work required to add the third party bundle by allowing it to be autoloaded.

Usage

Using Allegro is as easy as injecting it into the AppKernel file of your project. For example:

use carlosV2\Allegro\Allegro;
use Symfony\Component\HttpKernel\Kernel;

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            // Any bundle that you want to have manually added
        ];
        Allegro::appendTo($bundles);

        if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
            // Any bundle that you want to have manually added for tests
            Allegro::appendDevsTo($bundles);
        }

        return $bundles;
    }

    ...
}

That's it. Next time the AppKernel is read, Allegro will append any extra bundle automatically.

How

Allegro works by inspecting the composer packages for an specific configuration. If found, it reads and processes it so, making a bundle compatible with Allegro is as easy as providing the right configuration into its composer file.

This is the configuration that Allegro looks for on each composer.json file of each required package:

{
    "extra": {
        "symfony": {
            "bundles": ["Namespace\\BundleClass"]
        }
    }
}

Of course, you can set as many bundle classes as you need inside the array. Additionally, the root package (that means, the composer.json file of the Symfony project using Allegro) can also have this configuration in order to autoload the bundles.

Allegro assumes that packages inside require key are used for production while those inside require-dev are used only for development.

Install

In order to have Allegro you first need to require it through composer:

$ composer require carlosv2/allegro

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-11-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固