PHP code example of wethinkright / google-cloud-silex

1. Go to this page and download the library: Download wethinkright/google-cloud-silex library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wethinkright / google-cloud-silex example snippets




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();

$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'];



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

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



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

$app = new Application;

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

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