定制 pompdelux/kraken-bundle 二次开发

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

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

pompdelux/kraken-bundle

Composer 安装命令:

composer require pompdelux/kraken-bundle

包简介

Integrates Kraken.io into your Symfony2 application

README 文档

README

This bundle allows you to integrate kraken.io into your Symfony2 application.

Install:

  1. Add KrakenBundle to your dependencies:

     // composer.json
     {
         // ...
         "require": {
             // ...
             "pompdelux/kraken-bundle": "1.x"
         }
     }
    
  2. Use Composer to download and install the bundle:

     $ php composer.phar update pompdelux/kraken-bundle
    
  3. Register the bundle in your application:

     // app/AppKernel.php
     class AppKernel extends Kernel
     {
         // ...
         public function registerBundles()
         {
             $bundles = array(
                 // ...
                 new Pompdelux\KrakenBundle\KrakenBundle()
             );
         }
     }
    
  4. Add the configuration needed to use the bundle:

     // config.yml
     kraken:
         services:
             service_name:
                 api_key:    your-kraken.io-key
                 api_secret: your-kraken.io-secret
    

Usage:

Basic example:

$kraken = $this->container->get('pompdelux.kraken.service_name');
$result = $kraken->squeeze('http://example.com/some/public/image.jpg');

Example with callback rather than wait strategy:

# config.yml
kraken:
    services:
        ...
        callback_service:
            api_key:        your-kraken.io-key
            api_secret:     your-kraken.io-secret
            callback:       true
            callback_route: your_callback_route

# routing.yml
acme_kraken_callback:
    pattern: /my/kraken/callback
    defaults: { _controller: AcmeTestBundle:Kraken:callback }
    requirements:
        _method:  POST
$kraken = $this->container->get('pompdelux.kraken.callback_service');
$result = $kraken->squeeze('http://example.com/some/public/image.jpg');

// In AcmeTestBundle/Controller/KrakenController.php
//
// this method will be called once kraken.io is done processing your image.
public function callbackAction(Request $request)
{
    error_log(print_r($request->getContent(), 1));
    return new Response();
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-05-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固