public function __construct(Google_Client $client)
 {
     if (!function_exists('memcache_connect') && !class_exists("Memcached")) {
         throw new Google_Cache_Exception("Memcache functions not available");
     }
     if ($client->isAppEngine()) {
         // No credentials needed for GAE.
         $this->mc = new Memcached();
         $this->connection = true;
     } else {
         $this->host = $client->getClassConfig($this, 'host');
         $this->port = $client->getClassConfig($this, 'port');
         if (empty($this->host) || empty($this->port)) {
             throw new Google_Cache_Exception("You need to supply a valid memcache host and port");
         }
     }
 }