定制 merophp/bundle-manager 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

merophp/bundle-manager

最新稳定版本:0.1-beta

Composer 安装命令:

composer require merophp/bundle-manager

包简介

README 文档

README

Bundle manager for the merophp framework.

Installation

Via composer:

composer require merophp/bundle-manager

Basic Usage

require_once 'vendor/autoload.php';

use Merophp\BundleManager\BundleManager;

use Merophp\BundleManager\Collection\BundleCollection;
use Merophp\BundleManager\Provider\BundleProvider;
use Merophp\BundleManager\Bundle;

$collection = new BundleCollection();
$collection->addMultiple([
    new Bundle('MyOrganization\\MyBundlename'),
    new Bundle('MyOrganization\\MyBundlename2', ['myconfigKey'=>'myConfigValue']),
]);

$provider = new BundleProvider($collection);
$bundleManager = new BundleManager($provider);

$bundleManager->startRegisteredBundles();

Bundle Bootstrapping

A bundle must have a bootstrapper class which implements Merophp\BundleManager\BundleBootstrapper\BundleBootstrapperInterface. The bootstrapper class name is a compound of the bundle identifier as the namespace prefix and Bootstrapping/Bootstrapper. For the example above the fully qualified bootstrapper class name is MyOrganization\MyBundlename\Bootstrapping\Bootstrapper:


namespace MyOrganization\MyBundlename\Bootstrapping;

use Merophp\BundleManager\BundleBootstrapperInterface;

class Bootstrapper implements BundleBootstrapperInterface
{
    public function setConfiguration(array $configuration = [])
    {}

    public function setup()
    {}

    public function tearDown()
    {}
}

A bundle bootstrapper has the two lifecycle methods 'setup' and 'tearDown', which are called by the bundle manager. 'setup' will be called, when the bundle gets started and 'tearDown' will be called at the very end of the PHP execution.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-12-22