定制 mjr/code-generator-bundle 二次开发

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

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

mjr/code-generator-bundle

Composer 安装命令:

composer require mjr/code-generator-bundle

包简介

Code Generation based on twig

README 文档

README

This Bundle contains an Code Generator to rapidly Develope using Symfony Framework.

Installation

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

.. code-block:: bash

$ composer require mjr/code-generator-bundle "1.*"

This command requires you to have Composer installed globally, as explained in the installation chapter <https://getcomposer.org/doc/00-intro.md>_ of the Composer documentation.

Step 2: Enable the Bundle

Then, enable the bundle by adding the following line in the app/AppKernel.php file of your project:

.. code-block:: php

<?php
// app/AppKernel.php
use MjrOne\CodeGeneratorBundle\MjrOneCodeGeneratorBundle;

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new MjrOneCodeGeneratorBundle(),
        );

        // ...
    }
}

Step 3: Update Configuration

You might need to update/modify the Configuration of the Bundle. It is optimized twords Symfony. If you have a different Layout, okease check the Bundle Configuration file!

Supported Code Generators

Service

This Code Generator helps to create Simple Services with Automated Dependency Injection (both __constructor based as well as setter based). Support has been added for Controller Services (All Required options are set) All added Functions are put inside of a TraitServiceXX trait and added to Service Class. In case of an Controller, a Route Annotation is also added This is fully configurable over an annotation.

Mutator

Adds Getters & Setters as well as Methods to check if contains either a Value at all or checks on Array Value(array + array collection) [has]. For Array Collections and arrays the methods addXX, removeXX, countXX are also added. This is fully configurable over an annotation.

Entity

One Time Code Generation. Adds Repository Class if not exists This is fully configurable over an annotation.

Repository

adds some base functions to your repository. This is fully configurable over an annotation.

Commands

Generate Code

./bin/console mjr:generateCode --help  ✓  206  00:28:28 Usage: mjr:generateCode [options] [--]

Arguments: file File to Generator Code For

Options: -a, --all Update all Files in Bundle, -h, --help Display this help message -q, --quiet Do not output any message -V, --version Display this application version --ansi Force ANSI output --no-ansi Disable ANSI output -n, --no-interaction Do not ask any interactive question -e, --env=ENV The environment name [default: "prod"] --no-debug Switches off debug mode -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help: Generate MJRONE Bundle Codes

This is the Main Code Generator. If you add the flag -a or --all file needs to be the path to a bundle!

Update Routing Files

./bin/console mjr:generateRouting --help  ✓  208  00:34:16 Usage: mjr:generateRouting []

Arguments: cleanup remove Not Found Options

Options: -h, --help Display this help message -q, --quiet Do not output any message -V, --version Display this application version --ansi Force ANSI output --no-ansi Disable ANSI output -n, --no-interaction Do not ask any interactive question -e, --env=ENV The environment name [default: "production"] --no-debug Switches off debug mode -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help: Generates a bundle Routing

if the argument cleanup is added, the generator starts with an empty configuration file!

Bundle Generator

Controller Generator

Entity Generator

mjr/code-generator-bundle 适用场景与选型建议

mjr/code-generator-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 87 次下载、GitHub Stars 达 1, 最近一次更新时间为 2017 年 03 月 19 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「symfony」 「twig」 「bundle」 「code」 「generation」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 mjr/code-generator-bundle 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: LGPL-3.0
  • 更新时间: 2017-03-19