No description, website, or topics provided.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.github
metadata
src
tests
.gitattributes
CONTRIBUTING.md
LICENSE
README.md
VERSION
composer.json
phpunit-snippets.xml.dist Add Cloud Redis generated client (#1046) May 8, 2018
phpunit-system.xml.dist Add Cloud Redis generated client (#1046) May 8, 2018
phpunit.xml.dist
synth.py

README.md

Google Cloud Redis for PHP

Idiomatic PHP client for Google Cloud Redis.

Latest Stable Version Packagist

NOTE: This repository is part of Google Cloud PHP. Any support requests, bug reports, or development contributions should be directed to that project.

A fully managed Redis service for the Google Cloud Platform. Applications running on Google Cloud Platform can achieve extreme performance by leveraging the highly scalable, available, secure Redis service without the burden of managing complex Redis deployments.

Installation

To begin, install the preferred dependency manager for PHP, Composer.

Now to install just this component:

$ composer require google/cloud-redis

Or to install the entire suite of components at once:

$ composer require google/cloud

This component requires the gRPC extension. Please see our gRPC installation guide for more information on how to configure the extension.

Authentication

Please see our Authentication guide for more information on authenticating your client. Once authenticated, you'll be ready to start making requests.

Sample

require 'vendor/autoload.php';

use Google\Cloud\Redis\V1\CloudRedisClient;

$client = new CloudRedisClient();

$projectId = '[MY_PROJECT_ID]';
$location = '-'; // The '-' wildcard refers to all regions available to the project for the listInstances method
$formattedLocationName = $client->locationName($projectId, $location);
$response = $client->listInstances($formattedLocationName);
foreach ($response->iterateAllElements() as $instance) {
    printf('Instance: %s : %s' . PHP_EOL,
        $device->getDisplayName(),
        $device->getName()
    );
}

Version

This component is considered alpha. As such, it is still a work-in-progress and is more likely to get backwards-incompatible updates.

Next Steps

Take a look at and understand the official documentation.