承接 mi/metadata-puli-file-locator 相关项目开发

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

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

mi/metadata-puli-file-locator

最新稳定版本:v1.1.1

Composer 安装命令:

composer require mi/metadata-puli-file-locator

包简介

Puli-FileLocator for JMS Metadata

README 文档

README

Build Status Latest Stable Version Latest Unstable Version Total Downloads License StyleCI

Overview

...

Installation

  1. Add this library to your project as a composer dependency:
composer require mi/metadata-puli-file-locator

Usage

PuliDiscovery

For the usage of the puli discovery file locator use the PuliDiscoveryDriverFactory. To configure the metadata bind the query to "jms/serializer-metadata" with the parameter for the namespace prefix and the extension.

php puli.phar bind /puli/path/to/file/*.xml jms/serializer-metadata --param extension="xml" \
--namespace-prefix="Vendor\Namespace\Prefix"
$serializer =
JMS\Serializer\SerializerBuilder::create()
    ->setMetadataDriverFactory(new Mi\Puli\Serializer\Builder\PuliDiscoveryDriverFactory($puliDiscovery))
    ...
    ->build();

PuliRepository

For the usage of the puli repository file locator use the PuliRepositoryDriverFactory. Also the metadata are configure with the puli paths and namespace prefix.

$serializer =
JMS\Serializer\SerializerBuilder::create()
    ->addMetadataDir('/puli/path/to/file', 'Vendor\Namespace\Prefix')
    ->setMetadataDriverFactory(new Mi\Puli\Serializer\Builder\PuliRepositoryDriverFactory($puliRepository))
    ...
    ->build();

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

This library is under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-22