public function __construct(IWP_google_Client $client) { if (!function_exists('memcache_connect') && !class_exists("Memcached")) { throw new IWP_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 IWP_google_Cache_Exception("You need to supply a valid memcache host and port"); } } }