定制 cerpus/metadataservice-client 二次开发

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

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

cerpus/metadataservice-client

最新稳定版本:1.3.0

Composer 安装命令:

composer require cerpus/metadataservice-client

包简介

Client to handle communication with the Cerpus MetadataService

README 文档

README

PHP library to communicate with the Cerpus Metadata Service

Installation

Use composer to require the package

composer require cerpus/metadataservice-client

Laravel

When composer has finished, add the service provider to the providers array in config/app.php

Cerpus\MetadataServiceClient\Providers\MetadataServiceClientServiceProvider::class,

Add the following to the alias array in config/app.php

'MetadataService' => \Cerpus\MetadataServiceClient\MetadataServiceClient::class,

Publish the config file from the package

php artisan vendor:publish --provider="Cerpus\MetadataServiceClient\Providers\MetadataServiceClientServiceProvider" --tag=config

Lumen

Not tested, but should work. You are welcome to update this documentation if this does not work!

Add service provider in app/Providers/AppServiceProvider.php

public function register()
{
    $this->app->register(Cerpus\MetadataServiceClient\Providers\MetadataServiceClientServiceProvider::class);
}

Uncomment the line that loads the service providers in bootstrap/app.php

$app->register(App\Providers\AppServiceProvider::class);

Edit the configuration file

Edit config/metadataservice-client.php

<?php
return [
    "adapters" => [
        "cerpus-metadata" => [
            "handler" => \Cerpus\MetadataServiceClient\Adapters\MetadataServiceAdapter::class,
            "base-url" => '<url to service>',
        ],
    ],
];

Example for a developer setup:

<?php

return [
    "adapters" => [
        "cerpus-metadata" => [
            "handler" => \Cerpus\MetadataServiceClient\Adapters\CerpusMetadataServiceAdapter::class,
            "base-url" => env('METADATA_SERVER'),
        ],
    ],
];

Usage

Resolve from the Laravel Container

$cerpusMetadata = app(Cerpus\MetadataServiceClient\Contracts\MetadataServiceContract::class)

or alias

$cerpusMetadata = CerpusMetadataServiceAdapter::<Class Method>

or directly

$cerpusMetadata = new Cerpus\MetadataServiceClient\Adapters\CerpusMetadataServiceAdapter(Client $client);

The last one is not recommended.

Class methods

Method calls return an object or throws exceptions on failure.

More info

See the Confluence Metadata storage service API documentation

License

This package is released under the GNU General Public License 3.0. See the LICENSE file for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2021-10-12