承接 tilleuls/ovh-bundle 相关项目开发

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

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

tilleuls/ovh-bundle

最新稳定版本:v1.0.3

Composer 安装命令:

composer require tilleuls/ovh-bundle

包简介

OVH SDK integration

README 文档

README

This bundle integrates OVH's offical PHP SDK in the Symfony framework.

Build Status SensioLabsInsight Coverage Status

Installation

Use Composer to install the bundle:

composer require tilleuls/ovh-bundle

Then, update your app/config/AppKernel.php file:

    public function registerBundles()
    {
        $bundles = array(
            // ...
            new CoopTilleuls\OvhBundle\CoopTilleulsOvhBundle(),
            // ...
        );

        return $bundles;
    }

Configure the bundle in app/config/config.yml:

coop_tilleuls_ovh:
    endpoint_name:      "%ovh_endpoint_name%"
    application_key:    "%ovh_application_key%"
    application_secret: "%ovh_application_secret%"
    consumer_key:       "%ovh_consumer_key%"

Finally, update your app/config/parameters.yml file to store your OVH API credentials:

parameters:
    # ...
    ovh_endpoint_name:      "ovh-eu"
    ovh_application_key:    "MyOvhApplicationKey"
    ovh_application_secret: "MyOvhApplicationSecret"
    ovh_consumer_key:       "MyOvhConsumerKey"

Usage

The bundle automatically registers a ovh service in the Dependency Injection Container. That service is an instance of \Ovh\Api.

Example usage in a controller:

// ...

    public function smsAction(\Ovh\Api $ovhApi)
    {
        // Send a SMS
        $ovhApi
            ->post(
                sprintf('/sms/%s/users/%s/jobs', 'my-service-name', 'my-login'),
                [
                    'message' => 'Si tu veux me parler, envoie-moi un... fax !',
                    'receivers' => ['+33612345678'],
                    'sender' => 'my-login',
                ]
            )
        ;

        // ...
    }

// ...
}

Credits

Created by Kévin Dunglas for Les-Tilleuls.coop.

统计信息

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

GitHub 信息

  • Stars: 29
  • Watchers: 25
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-12-20