Skip to content

Instantly share code, notes, and snippets.

@ataylorme
Forked from sean-e-dietrich/enable_redis.php
Created August 24, 2016 14:12
Show Gist options
  • Save ataylorme/615ed3d9534b51750f29dbc6cd3df113 to your computer and use it in GitHub Desktop.
Save ataylorme/615ed3d9534b51750f29dbc6cd3df113 to your computer and use it in GitHub Desktop.
Enable Redis
<?php
if (isset($_POST['environment'])){
$req = pantheon_curl('https://api.live.getpantheon.com/sites/self/settings', NULL, 8443);
$meta = json_decode($req['body'], true);
if($meta['allow_cacheserver'] != 1){
$req = pantheon_curl('https://api.live.getpantheon.com/sites/self/settings', '{"allow_cacheserver":true}', 8443, 'PUT');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment