/** * Set configuration specific to a given class. * $config->setClassConfig('Google\Cache\File', * array('directory' => '/tmp/cache')); * @param $class string|object - The class name for the configuration * @param $config string key or an array of configuration values * @param $value string optional - if $config is a key, the value * */ public function setClassConfig($class, $config, $value = null) { if (!is_string($class)) { $class = get_class($class); } $this->config->setClassConfig($class, $config, $value); }
/** * Construct the Google Client. * * @param $config Google\Config or string for the ini file to load */ public function __construct($config = null) { if (is_string($config) && strlen($config)) { $config = new Config($config); } else { if (!$config instanceof Config) { $config = new Config(); if ($this->isAppEngine()) { // Automatically use Memcache if we're in AppEngine. $config->setCacheClass('Google\\Cache\\Memcache'); } if (version_compare(phpversion(), "5.3.4", "<=") || $this->isAppEngine()) { // Automatically disable compress.zlib, as currently unsupported. $config->setClassConfig('Google\\Http\\Request', 'disable_gzip', true); } } } if ($config->getIoClass() == Config::USE_AUTO_IO_SELECTION) { if (function_exists('curl_version') && function_exists('curl_exec') && !$this->isAppEngine()) { $config->setIoClass("Google\\IO\\Curl"); } else { $config->setIoClass("Google\\IO\\Stream"); } } $this->config = $config; }