2017 © Pedro Peláez
 

library google-cloud-silex

A Silex Service Provider for Google Cloud PHP

image

wethinkright/google-cloud-silex

A Silex Service Provider for Google Cloud PHP

  • Sunday, November 13, 2016
  • by jdpedrie
  • Repository
  • 1 Watchers
  • 2 Stars
  • 1,214 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 9 % Grown

The README.md

Google Cloud PHP Silex Service Provider

Build Status codecov, (*1)

This package makes integrating Google Cloud PHP into your Silex application quick and easy., (*2)

Installation

$ composer require wethinkright/google-cloud-silex

Usage

To learn how ServiceProviders work and how they can be loaded in your application, refer to the Silex Documentation., (*3)

<?php

use Silex\Application;
use WeThinkRight\GoogleCloudSilex\GoogleCloudProvider;

$app = new Application;
$app->register(new GoogleCloudProvider(), [
    'cloud.config' => [
        'keyFilePath' => '/path/to/service/account/credentials.json'
    ]
]);

$pubsub = $app['cloud']->pubsub();

Services

Services are provided for your convenience for each of the Google Cloud PHP APIs., (*4)

$bigquery = $app['cloud.bigquery'];
$datastore = $app['cloud.datastore'];
$logging = $app['cloud.logging'];
$language = $app['cloud.language'];
$pubsub = $app['cloud.pubsub'];
$speech = $app['cloud.speech'];
$storage = $app['cloud.storage'];
$translate = $app['cloud.translate'];
$vision = $app['cloud.vision'];

Configuration

To learn how to configure Google Cloud PHP, refer to the Google\Cloud\ServiceBuilder::__construct() documentation., (*5)

  • The configuration array can be provided when registering the Service Provider:
<?php

use Silex\Application;
use WeThinkRight\GoogleCloudSilex\GoogleCloudProvider;

$app = new Application;
$app->register(new GoogleCloudProvider(), [
    'cloud.config' => [
        'keyFilePath' => '/path/to/service/account/credentials.json'
    ]
]);
  • Or, it can be assigned prior to registering the Service Provider:
<?php

use Silex\Application;
use WeThinkRight\GoogleCloudSilex\GoogleCloudProvider;

$app = new Application;

$app['cloud.config'] = [
    'keyFilePath' => '/path/to/service/account/credentials.json'
];

$app->register(new GoogleCloudProvider());

License

This package is licensed under the Apache 2.0 software license. See LICENSE for more information., (*6)

The Versions

13/11 2016

dev-master

9999999-dev

A Silex Service Provider for Google Cloud PHP

  Sources   Download

Apache 2.0

The Requires

 

The Development Requires

by John Pedrie

13/11 2016

v1.0

1.0.0.0

A Silex Service Provider for Google Cloud PHP

  Sources   Download

Apache 2.0

The Requires

 

The Development Requires

by John Pedrie