tychovbh/laravel-bluebillywig 问题修复 & 功能扩展

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

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

tychovbh/laravel-bluebillywig

Composer 安装命令:

composer require tychovbh/laravel-bluebillywig

包简介

A BlueBillyWig bridge for Laravel 5

README 文档

README

Latest Version on Packagist Software License Total Downloads

Laravel Blue Billywig is created by, and is maintained by Tycho, and is a Laravel/Lumen package to connect with Blue Billywig API. Feel free to check out the change log, releases, license, and contribution guidelines

Install

Laravel Blue Billywig requires PHP 7.1 or 7.2. This particular version supports Laravel 5.5 - 5.7 only and Lumen.

To get the latest version, simply require the project using Composer.

$ composer require tychovbh/laravel-bluebillywig

Once installed, if you are not using automatic package discovery, then you need to register the Tychovbh\Bluebillywig\BluebillywigServiceProvider service provider in your config/app.php.

In Lumen add de Service Provider in bootstrap/app.php:

$app->register(\Tychovbh\Bluebillywig\BluebillywigServiceProvider::class);

Configuration

Laravel Blue Billywig requires publication configuration.

To get started, you'll need to publish all vendor assets:

$ php artisan vendor:publish --tag=laravel-bluebillywig

This will create a config/bluebillywig.php file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases.

In lumen you have to create the configuration file manually since vendor:publish is not available. Create the file config/bluebillywig.php and copy paste the example file.

There are two config options:

Default publication Name

This option ('default') is where you may specify which of the publications below you wish to use as your default publication for all work. Of course, you may use many connections at once using the $bluebillywig->publication('my_publication') method. The default value for this setting is 'public'.

Bluebillywig Publications

This option ('publications') is where each of the publications are setup for your application. Example configuration has been included, but you may add as many publications as you would like.

Usage

Bluebillywig

This is the class of most interest. This will send authenticated requests to Blue Billywig API. Go to their documentation for all available endpoints.

Real Examples

Instantiate Bluebillywig class:

use Tychovbh\Bluebillywig\Bluebillywig;

// Use class injection
Route::get('/bluebillywig', function(Bluebillywig $bluebillywig) {
    $response = $bluebillywig->retrieve('/sapi/publication')
    return response()->json($response)
});

// Or use Laravel helper app()
Route::get('/bluebillywig', function() {
    $bluebillywig = app('bluebillywig');
    $response = $bluebillywig->retrieve('/sapi/publication')
    return response()->json($response)
});

Available Bluebillywig methods:

// The examples below use the default publication. 
$response = $bluebillywig->retrieve('/sapi/mediaclip')
$response = $bluebillywig->retrieve('/sapi/mediaclip/' . $id)
$response = $bluebillywig->create('/sapi/mediaclip', $formData)
$response = $bluebillywig->update('/sapi/mediaclip/{id}', $id, $formData)
$response = $bluebillywig->delete('/sapi/mediaclip', $id)

// in this example we request data from my_publication. 
// my_publication key should be added to publications in the confiugration file. 
$response = $bluebillywig->publication('my_publication')->retrieve('/sapi/playlist')

// You can use other API endpoints like /json/mediaclip:
$response = $bluebillywig>retrieve('/json/mediaclip')

You can send parameters with some of the requests:

// Request with GET parameter 'limit=10'
$response = $bluebillywig->retrieve('/sapi/mediaclip', [
    'limit' => 10
])

// Create resource
$response = $bluebillywig->create('/sapi/mediaclip', [
    'title' => 'my fantastic new title',
])

// Update resource
$response = $bluebillywig->update('/sapi/mediaclip/{id}', $id, [
    'title' => 'my fantastic new title',
])

You will need to handle Exceptions from Bluebillywig yourself:

use Tychovbh\Bluebillywig\Exceptions\ConfigurationException;

try {
    $bluebillywig = app('bluebillywig');
    $bluebillywig->retrieve('/sapi/mediaclip')
} catch(\ConfigurationException $exception) {
    echo $exception->getMessage();
} catch(\GuzzleException $exception) {
    echo $exception->getMessage();
} catch(\Exception $exception) {
    echo $exception->getMessage();
}

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

For testing tests/feature/* copy tests/.env.example to tests/.env and fill in your Blue Billywig testing account credentials.

$ composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email info@bespokeweb.nl instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

tychovbh/laravel-bluebillywig 适用场景与选型建议

tychovbh/laravel-bluebillywig 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 77 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 10 月 28 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 tychovbh/laravel-bluebillywig 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-10-28