tccltd/tcc-abstract-module 问题修复 & 功能扩展

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

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

tccltd/tcc-abstract-module

Composer 安装命令:

composer require tccltd/tcc-abstract-module

包简介

TccAbstractModule Package

README 文档

README

Provides an AbstractModule class that can be extended by individual Module classes to automatically implement functionality such as autoloading and configuration.

Installation

Simply add tccltd/tcc-abstract-module to your composer.json.

Usage

When creating a new module, extend TccAbstractModule\Module\AbstractModule in your Module.php.

PHP 5.3 NOTE: If you are not using PHP 5.4 then you will need to extend TccAbstractModuleNoTraits instead of TccAbstractModule. The functionality provided is identical.

For simpler modules, you may well find that this is all you need:

namespace MyModule;

use TccAbstractModule\Module\AbstractModule;

class Module extends AbstractModule
{
}

The abstract module configures the following behaviour automatically:

  1. Autoloading: The classmap defined in ./autoload_classmap.php is used in the first instance, falling back to a standard PSR-0 compatible autoloader serving files from ./src/MyModule/.

  2. Module Configuration: All files in ./config/ matching the format module.config{,.*}.php will be loaded. As a matter of good practice, you should separate your routes into module.config.routes.php.

  3. Service Configuration: Where previously you would have defined service manager invokables, services, factories, aliases, initializers and abstract_factories in the getServiceConfig() function of your Module.php, these should now be defined in ./config/service/service.config.php. The format is the same. Note that all files in ./config/service/ matching the format service.config{,.*}.php will be loaded, should you wish to further subdivide your service configuration.

  4. Controller Configuration: Where previously you would have defined controller manager invokables, services, factories, aliases, initializers and abstract_factories in the getControllerConfig() function of your Module.php, these should now be defined in ./config/service/controller.config.php. The format is the same. Note that all files in ./config/service/ matching the format controller.config{,.*}.php will be loaded, should you wish to further subdivide your controller configuration.

  5. View Helper Configuration: Where previously you would have defined view helper manager invokables, services, factories, aliases, initializers and abstract_factories in the getViewHelperConfig() function of your Module.php, these should now be defined in ./config/service/viewhelper.config.php. The format is the same. Note that all files in ./config/service/ matching the format service.config{,.*}.php will be loaded, should you wish to further subdivide your view helper configuration.

A typical file structure (focusing on the aspects related to this module) might be as follows:

module/  
  MyModule/  
    config/  
      service/  
        controller.config.php  
        service.config.php  
        viewhelper.config.php  
      module.config.php  
      module.config.routes.php  
  autoload_classmap.php  
  Module.php  

Overriding

Should you wish to modify the behaviour of the AbstractModule, you can do so by either overriding in your individual Module.php files, or you can extend the entire module and create your own AbstractModule. If you have a suggestion that might benefit all users of this module, please do feel free to suggest it, of course!

Traits

TccAbstractModule is composed of traits. This means that you can, should you wish, cherry-pick the functionality that you would like to use. In this instance you would not override AbstractModule. Instead, you would use the relevant traits within your own Module class. Note that you will need to use ClassDirTrait in order to use any of the other traits, and ClassNamespaceTrait in order to use AutoloaderProviderDefaultTrait.

It is anticipated that most users will not need to cherry-pick.

tccltd/tcc-abstract-module 适用场景与选型建议

tccltd/tcc-abstract-module 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 208 次下载、GitHub Stars 达 1, 最近一次更新时间为 2013 年 10 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 tccltd/tcc-abstract-module 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 tccltd/tcc-abstract-module 我们能提供哪些服务?
定制开发 / 二次开发

基于 tccltd/tcc-abstract-module 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2013-10-25