Skip to content

Instantly share code, notes, and snippets.

@austintgriffith
Created July 28, 2016 13:20
Show Gist options
  • Save austintgriffith/1966c5ba9eda567fc72b3b955981a210 to your computer and use it in GitHub Desktop.
Save austintgriffith/1966c5ba9eda567fc72b3b955981a210 to your computer and use it in GitHub Desktop.
Php file to test the predis connection
<?php
echo "Loading autoloader...";
require '/var/www/vendor/autoload.php';
echo "Registering predis...";
Predis\Autoloader::register();
echo "Creating client...";
// Parameters passed using a named array:
$client = new Predis\Client([
'scheme' => 'tcp',
'host' => '**DNS**',
'port' => **PORT**,
]);
echo "Setting value...";
$value = $client->set('test','testie');
echo "Getting value...";
$value = $client->get('test');
echo "done";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment