public function __construct($config = array()) { global $apiConfig; $apiConfig = array_merge($apiConfig, $config); self::$cache = new $apiConfig['cacheClass'](); self::$auth = new $apiConfig['authClass'](); self::$io = new $apiConfig['ioClass'](); }
public function __construct($config = array()) { global $apiConfig; if (isset($apiConfig) && is_array($apiConfig)) { $this->googleConfig = $apiConfig; } if (!isset($this->googleConfig['ioFileCache_directory'])) { $this->googleConfig['ioFileCache_directory'] = function_exists('sys_get_temp_dir') ? sys_get_temp_dir() . '/Google_Client' : '/tmp/Google_Client'; } $this->googleConfig = array_merge($this->googleConfig, $config); $cache_object_type = $this->googleConfig['cacheClass']; $auth_object_type = $this->googleConfig['authClass']; $io_object_type = $this->googleConfig['ioClass']; self::$cache = new $cache_object_type($this->googleConfig); self::$auth = new $auth_object_type($this->googleConfig); self::$io = new $io_object_type(); $GLOBALS['googleApiConfig'] = $this->googleConfig; }