blast-project/core-bundle 问题修复 & 功能扩展

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

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

blast-project/core-bundle

Composer 安装命令:

composer require blast-project/core-bundle

包简介

This is the core of Libre Informatique Symfony2 projects

README 文档

README

Scrutinizer Travis Coveralls License

Latest Stable Version Latest Unstable Version Total Downloads

The goal of this bundle is to make the use of SonataAdmin "view-models" possible without writting a line of PHP, without loosing a feature of Sonata, and importing the idea of composite settings using lots of characteristics of an admin (its direct inheritance tree, the traits used by its Entity, the inheritance tree of its Entity...), making things more flexible, extendable, reusable and maintenable through many bundles and uses.

This bundle is the next step after the SonataAdminBundle. Configure an entire backend bundle filling only YAML files... Try it!

It is also the core of Libre Informatique's Symfony 2/3 projects.

Example

I want to design and create a bundle as a toolbox for other bundles' entities. It will provide traits for email addresses and phonenumbers, for instance (cf. BlastBaseEntitiesBundle).

Using the BlastCoreBundle, your "base" bundle will carry the traits, but also the way to display properties given by its traits in a SonataAdmin (which becomes a CoreAdmin) CRUD. Then using the traits of your "base" bundle in the entities of other bundles (also implementing the BlastCoreBundle) will add the fields naturally, the columns in the list of objects, etc... as you set up for your trait in your "base" bundle, without having to write a line for this.

Imagine this feature appliable to 50 entities distributed in 10 bundles, and count in your mind the number of saved lines, the number of potential bugs avoided and the ease of maintenance when you want to change the nature of the field used by the provided email address or phonenumber... This is what the BlastCoreBundle permits.

Installation

Prerequisites

  • having a working Symfony2 environment
  • having created a working Symfony2 app (including your DB and your DB link)
  • having composer installed (here in /usr/local/bin/composer, with /usr/local/bin in the path)

Downloading

$ composer require blast-project/core-bundle dev-master

This will download and install :

  • knplabs/knp-menu
  • knplabs/knp-menu-bundle
  • cocur/slugify
  • sonata-project/core-bundle
  • sonata-project/cache
  • sonata-project/block-bundle
  • sonata-project/exporter
  • twig/extensions
  • sonata-project/admin-bundle
  • sonata-project/doctrine-orm-admin-bundle
  • blast-project/core-bundle
  • libre-informatique/base-entities-bundle
  • twig/twig ^1.22.1

Third party bundles, Sonata bundles

Please refer to the Sonata Project's instructions, foundable here : https://sonata-project.org/bundles/admin/3-x/doc/reference/installation.html https://sonata-project.org/bundles/user/3-x/doc/reference/installation.html

And follow the installation guides.

At the end, you should have a app/AppKernel.php that looks like that:

<?php

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            //...

            // Add your dependencies
            new Sonata\CoreBundle\SonataCoreBundle(),
            new Sonata\BlockBundle\SonataBlockBundle(),
            new Knp\Bundle\MenuBundle\KnpMenuBundle(),
            //...

            // If you haven't already, add the storage bundle
            // This example uses SonataDoctrineORMAdmin but
            // it works the same with the alternatives
            new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(),

            // You have 2 options to initialize the SonataUserBundle in your AppKernel,
            // you can select which bundle SonataUserBundle extends
            // Most of the cases, you'll want to extend FOSUserBundle though ;)
            // extend the ``FOSUserBundle``
            //new FOS\UserBundle\FOSUserBundle(),
            //new Sonata\UserBundle\SonataUserBundle('FOSUserBundle'),
            // OR
            // the bundle will NOT extend ``FOSUserBundle``
            //new Sonata\UserBundle\SonataUserBundle(),

            // Then add SonataAdminBundle
            new Sonata\AdminBundle\SonataAdminBundle(),
            new Blast\CoreBundle\BlastCoreBundle(),

            //...
        ];
        //...
    }
    //...
}

And at the end of the app/config/config.yml file:

# ...
sonata_block:
    default_contexts: [cms]
    blocks:
        # Enable the SonataAdminBundle block
        sonata.admin.block.admin_list:
            contexts:   [admin]
        # Your other blocks

PostgreSQL

Create the database needed

If you are using PostgreSQL as your main database, you'll need to install postgresql-contrib and load the "uuid-ossp" extension :

  $ sudo apt-get install postgresql-contrib
  $ echo 'CREATE EXTENSION "uuid-ossp";' | psql [DB]

The "libre-informatique" bundles

Edit your app/AppKernel.php file and add your "libre-informatique" bundle, for instance the "libre-informatique/core-bundle" :

    // app/AppKernel.php
    // ...
    public function registerBundles()
    {
        $bundles = array(
            // ...

            // The libre-informatique bundles
            new Blast\CoreBundle\BlastCoreBundle(),

            // your personal bundles
        );
    }

Usages

Configuring your SonataAdminBundle interfaces with YAML properties

Discover the configuration of the CoreBundle.

Going further...

Read more about the CoreBundle, and how to improve the SonataAdminBundle

Improving the SonataAdminBundle in a generic way

Configuring a standalone bundle

Discover the configuration of a standalone bundle.

Going further using the CoreAdmin

Instead of the Blast\CoreBundle\Admin\Traits\Base trait, you might be interested in :

  • Blast\CoreBundle\Admin\Traits\Embedded: if the current CoreAdmin aims to be embedded
  • Blast\CoreBundle\Admin\Traits\Embedding: if the current CoreAdmin aims to embed other forms and you want its embedding fields to be treated automatically

Creating new field types.

Using Sonata Project extensions

If needed, you can easly use the BlastCoreBundle in combination with other bundles from the Sonata Project, for instance :

Please refer yourself to the proper documentation from the Sonata Project...

Managing entities dashboard groups

Discover the configuration of the dashboard.

Using Blast Core command tools for patches

Discover how to implement patches

blast-project/core-bundle 适用场景与选型建议

blast-project/core-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2016 年 11 月 24 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 blast-project/core-bundle 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: LGPL-3.0
  • 更新时间: 2016-11-24