承接 hostnet/entity-tracker-bundle 相关项目开发

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

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

hostnet/entity-tracker-bundle

Composer 安装命令:

composer require hostnet/entity-tracker-bundle

包简介

Wraps around the hostnet/entity-tracker-component and allows configuration of several listener components

README 文档

README

Documentation

What is the Entity Tracker Bundle?

The Entity Tracker Bundle is a bundle used to configure the following components:

It will let you configure those components using the config.yaml

Note: Only the Entity Tracker Component is mandatory, as this bundle configures the services. The other components only need to be configured if they are present.

Requirements

The tracker bundle requires at least php 7.3 and runs on Doctrine2 and Symfony2. For specific requirements, please check composer.json

Installation

Installing is pretty easy, this package is available on packagist. You can register the package locked to a major as we follow Semantic Versioning 2.0.0.

Example

    "require" : {
        "hostnet/entity-tracker-bundle" : "^2.0.0"
    }

Note: You can use dev-master if you want the latest changes, but this is not recommended for production code!

Documentation

How does it work?

It features a config builder that allows you to config only what you need. If you have the "Blamable" annotation available, it will throw an exception during container compilation if it's not configured. The same goes for all other supported components. If you happen to configure it while it isn't used, it will also let you know.

Setup

Register The Bundle in your AppKernel

This bundle is not dependent on others based on compiler passes or configuration.

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            // ...
            new Hostnet\Bundle\EntityTrackerBundle\HostnetEntityTrackerBundle()
            // ...
        ];

        return $bundles;
    }
}

Configuration Overview

By default, nothing is required. Only when you enable a certain configuration option, it will yell you what's missing.

If you are using entities in your bundle, your bundle should have a dependency on the component using the specific annotation you use. If your bundle is in your application, your application should have a dependency on the component. If you use the hostnet/entity-plugin-lib, you will have separate packages for entities. You should put your dependencies on that package.

Note: Based on what is available, the configuration requirements are determined. If one of the bundles or Entity packages has a dependency on one of the components, this bundle will also configure it for you.

The template is as following:

# Default configuration for extension with alias: "hostnet_entity_tracker"
hostnet_entity_tracker:

    # Configures and enables the blamable listener
    blamable:

        # Provider implementation of Hostnet\Component\EntityBlamable\Provider\BlamableProviderInterface
        provider: ~ # Required

    # Configures and enables the revision listener
    revision:

        # Factory implementation of Hostnet\Component\EntityRevision\Factory\RevisionFactoryInterface
        factory: ~ # Required

    # Configures and enables the mutation listener
    mutation: ~
Configuring the Blamable Component

The Blamable Component has 1 required option, the provider. The provider is the class that implements the BlamableProviderInterface as explained in the documation. The argument passed to that option is the name of the service you are using for it. There are two ways you can go about using these providers. The first way is to make use of the default blamamable provider that is shipped with this bundle. This can be done using the following method:

config.yaml

hostnet_entity_tracker:
    blamable:
        provider: entity_tracker.provider.blamable
        default_username: "username for example purposes"

It is also possible to create your own BlamamableProvider by implementing the BlamableProviderInterface. If you choose to do this the following method can be used to make use of your custom BlamableProvider.

Note: The following example is based on the AcmeBlamableProvider from the link above

services.yaml

services:
    acme.provider.blamable:
        class: Acme\Bundle\AcmeBundle\Service\AcmeBlamableProvider
        arguments:
            - 'username for example purposes'

config.yaml

hostnet_entity_tracker:
    blamable:
        provider: acme.provider.blamable
Configuring the Mutation Component

The Mutation Component has no required options. All you have to do to enable it, is add "mutation: ~" to the config.

config.yaml

hostnet_entity_tracker:
    mutation: ~
Configuring the Revision Component

The Revision Component has 1 required option, the factory. The factory is the class that implements the RevisionFactoryInterface as explained in the documation. The argument passed to that option is the name of the service you are using for it.

Note: The following example is based on the AcmeRevisionFactory from the link above

services.yaml

services:
    acme.factory.revision:
        class: Acme\Bundle\AcmeBundle\Service\AcmeBlamableProvider
        arguments:
            - 'author->name for example purposes'

config.yaml

hostnet_entity_tracker:
    revision:
        factory: acme.factory.revision

hostnet/entity-tracker-bundle 适用场景与选型建议

hostnet/entity-tracker-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 111.05k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2014 年 08 月 12 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 hostnet/entity-tracker-bundle 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 111.05k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 21
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 4
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-08-12