setono/kraken-io-bundle 问题修复 & 功能扩展

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

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

setono/kraken-io-bundle

最新稳定版本:v1.1.0

Composer 安装命令:

composer require setono/kraken-io-bundle

包简介

Symfony bundle that integrates the kraken.io PHP SDK

README 文档

README

Latest Version Latest Unstable Version Software License Build Status Code Coverage

Integrates the kraken.io PHP SDK into Symfony.

Installation

Step 1: Download the bundle

$ composer require setono/kraken-io-bundle

Step 2: Enable the bundle

Enable the plugin by adding it to the list of registered plugins/bundles in config/bundles.php:

<?php
$bundles = [
    // ...
    
    Setono\KrakenIoBundle\SetonoKrakenIoBundle::class => ['all' => true],
    
    // ...
];

Step 3: Add configuration

# config/packages/setono_kraken_io.yaml
setono_kraken_io:
    api_key: your_api_key
    api_secret: your_api_secret

Usage

Now you can inject the ClientInterface into your service:

<?php
namespace App\Image;

use Setono\Kraken\Client\ClientInterface;

final class Optimizer
{
    private $client;
    
    public function __construct(ClientInterface $client)
    {
        $this->client = $client;
    }
}

With auto wiring this will work out of the box. If you're not using auto wiring you have to inject it in your service definition:

<?xml version="1.0" encoding="UTF-8" ?>

<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
    <services>
        <service id="YourService">
            <argument type="service" id="Setono\Kraken\Client\ClientInterface"/>
        </service>
    </services>
</container>

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-02-24