定制 as3/modlr-bundle 二次开发

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

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

as3/modlr-bundle

Composer 安装命令:

composer require as3/modlr-bundle

包简介

Symfony bundle for the Modlr REST ODM library.

README 文档

README

Scrutinizer Code Quality Build Status Packagist SensioLabsInsight

Integrates the modlr REST libraries with Symfony.

Installation

To utilize modlr, you must install a persister and an api specification.

To utilize search within modlr, you must install a search client.

Available modules can be found here, or you can write your own!

Install packages with Composer

To install this bundle with support for MongoDB, elasticsearch and the JSON Api Spec, add the following to your composer.json file:

{
    "require": {
        "as3/modlr-bundle": "dev-master",
        "as3/modlr-api-jsonapiorg": "dev-master",
        "as3/modlr-search-elastic": "dev-master",
        "as3/modlr-persister-mongodb": "dev-master"
    }
}

Then, tell Composer to update and install the requested packages:

composer update as3/modlr-bundle --with-dependencies

Register the Bundle

Once installed, register the bundle in your AppKernel.php:

// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // ...
        new As3\Bundle\ModlrBundle\As3ModlrBundle(),
    );

    // ...
}

Configuration

Modlr requires some configuration in order to work. You can use the default config below to get started:

# app/config/config.yml
as3_modlr:
    rest:
        root_endpoint: /api
        debug: "%kernel.debug%"
    adapter:
        type: jsonapiorg
    persisters:
        default:
            type: mongodb
            parameters:
                host: mongodb://localhost:27017
    search_clients:
        default:
            type: elastic

To utilize the external REST API, you must also include modlr's routing file. This will allow modlr to handle all requests to as3_modlr.rest.root_endpoint. To prevent any routing conflicts, you should add this before any other bundle or your application route definitions.

# app/config/routing.yml
as3_modlr_bundle:
    resource: "@As3ModlrBundle/Resources/config/routing.yml"

Next you must define your models! By default, modlr's metadata driver will look for YAML files in app/Resources/As3ModlrBundle/models and app/Resources/As3ModlrBundle/mixins.

You can customize where your definitions are stored by setting the models_dir parameter of your metadata driver. See the bundle configuration documentation for more information.

Usage

See modlr documentation for additional information.

This bundle provides commands to rebuild modlr's metadatacache:

app/console as3:modlr:metadata:cache:clear [model_type] [--no-warm]

Create collection schema:

app/console as3:modlr:schema:create [model_type]

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2016-03-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固