コード例 #1
0
 public function __construct($extra_config = array())
 {
     parent::__construct();
     if (!empty($extra_config) && is_array($extra_config)) {
         $merged_configuration = $extra_config + $this->configuration;
         if (isset($extra_config['classes']) && isset($this->configuration['classes'])) {
             $merged_configuration['classes'] = $extra_config['classes'] + $this->configuration['classes'];
         }
         $this->configuration = $merged_configuration;
     }
 }
コード例 #2
0
 /**
  * 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 App_Google_Config($config);
     } else {
         if (!$config instanceof App_Google_Config) {
             $config = new App_Google_Config();
             if ($this->isAppEngine()) {
                 // Automatically use Memcache if we're in AppEngine.
                 $config->setCacheClass('App_Google_Cache_Memcache');
             }
             if (version_compare(phpversion(), "5.3.4", "<=") || $this->isAppEngine()) {
                 // Automatically disable compress.zlib, as currently unsupported.
                 $config->setClassConfig('App_Google_Http_Request', 'disable_gzip', true);
             }
         }
     }
     if ($config->getIoClass() == App_Google_Config::USE_AUTO_IO_SELECTION) {
         if (function_exists('curl_version') && function_exists('curl_exec') && !$this->isAppEngine()) {
             $config->setIoClass("App_Google_IO_Curl");
         } else {
             $config->setIoClass("App_Google_IO_Stream");
         }
     }
     $this->config = $config;
 }