承接 phpmob/settings-bundle 相关项目开发

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

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

phpmob/settings-bundle

Composer 安装命令:

composer require phpmob/settings-bundle

包简介

Just a Symfony settings bundle.

README 文档

README

Scrutinizer Code Quality Code Coverage Build Status Latest Stable Version Latest Unstable Version

Just a Settings Library.

Installation

Install via composer.

$ composer require phpmob/settings-bundle

Using with cache

$ composer require cache/filesystem-adapter

Now you can use built-in \PhpMob\Settings\Manager\CachedManager.

Alternative using built-int symfony framework cache see - framework/cache

Sample config

# use with doctrine orm
doctrine:
    orm:
        mappings:
            PhpMobSettings:
                type: xml
                is_bundle: false
                prefix: PhpMob\Settings\Model
                dir: '%kernel.project_dir%/vendor/phpmob/settings-bundle/src/Resources/config/doctrine/model'


phpmob_settings:
    cache:
        service: cache.flysystem
    schemas:
        section1:
            label: Section1
            settings:
                key1: ~
        section2:
            label: Section2
            settings:
                key1:
                    value: key1Value
                key2:
                    label: SectionKey2
                    value: key2value
                    blueprint:
                        options:
                            label: SectionKey2Label
                        constraints:
                            NotBlank: ~
                gender:
                    label: Gender
                    value: f
                    blueprint:
                        type: Symfony\Component\Form\Extension\Core\Type\ChoiceType
                        options:
                            required: true
                            choices:
                                Man: m
                                Feman: f
                birthday:
                    type: date
                    label: Birthday
                    value: "1988-02-10"
                    blueprint:
                        type: Symfony\Component\Form\Extension\Core\Type\BirthdayType
                datetime:
                    type: datetime
                    label: DateTime
                    value: ~
                    blueprint:
                        type: Symfony\Component\Form\Extension\Core\Type\DateTimeType

Ownered settings

Configuration for owner (user) aware settings. Controller used PhpMobSettingsBundle:Update:userUpdate.

phpmob_settings:
    schemas:
        section1:
            owner_aware: true
            label: Section1
            settings:
                key1: ~

Updater Routing

See example routing in src/Resources/config/routing.xml or you can customize with:

your_route_name:
    path: /settings/{section}
    defaults:
        _controller: PhpMobSettingsBundle:Update:globalUpdate
        _template: @yourtemplate # default @PhpMobSetting/default.html.twig
        _flash: ~ # flash message after update
        _redirect: ~ # redirect after update

Custom form type to display description setting in form view.

<?php

namespace YourBundle\Form\Type;

use PhpMob\SettingsBundle\Form\Type\AbstractBlueprintType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;

class YourSettingType extends AbstractBlueprintType
{
    /**
     * {@inheritdoc}
     */
    public function getParentType(): string
    {
        return CheckboxType::class;
    }
}

And in setting configuration.

phpmob_settings:
    schemas:
        section1:
            owner_aware: true
            label: Section1
            settings:
                key1:
                    type: boolean
                    label: 'Key 1'
                    value: true
                    blueprint:
                        type: YourBundle\Form\Type\YourSettingType

using in twig

Getter setting

{{ settings_get('section.key') }}

{# owner aware setting #}
{{ settings_get('section.key', app.user) }}

Setter setting

{{ settings_set('section.key', 'value') }}

{# owner aware setting #}
{{ settings_set('section.key', 'value', app.user) }}

Sample Admin Screen

screen

Contributing

Would like to help us and build the developer-friendly php code? Just follow our Coding Standards and test your code — see tests, spec.

Let Fork and PR now!

Coding Standards

When contributing code to PhpMob, you must follow its coding standards.

PhpMob follows the standards defined in the PSR-0, PSR-1 and PSR-2 documents.

$ ./bin/ecs check src --fix

Tests

$ ./bin/phpunit

LICENSE

MIT

phpmob/settings-bundle 适用场景与选型建议

phpmob/settings-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 113.21k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2017 年 10 月 04 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-10-04