/** * @return Google_IO_Abstract IO implementation */ public function getIo() { if (!isset($this->io)) { $class = $this->config->getIoClass(); $this->io = new $class($this); } return $this->io; }
/** * Construct the Google Client. * * @param $config Config or string for the ini file to load */ public function __construct($config = null) { if (!ini_get('date.timezone') && function_exists('date_default_timezone_set')) { date_default_timezone_set('UTC'); } if (is_string($config) && strlen($config)) { $config = new Google_Config($config); } else { if (!$config instanceof Google_Config) { $config = new Google_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() == Google_Config::USE_AUTO_IO_SELECTION) { if (function_exists('curl_version')) { $config->setIoClass("Google_Io_Curl"); } else { $config->setIoClass("Google_Io_Stream"); } } $this->config = $config; }