@@ -39,117 +39,117 @@ discard block |
||
| 39 | 39 | */ |
| 40 | 40 | public function __construct($ini_file_location = null) |
| 41 | 41 | { |
| 42 | - $this->configuration = array( |
|
| 43 | - // The application_name is included in the User-Agent HTTP header. |
|
| 44 | - 'application_name' => '', |
|
| 45 | - |
|
| 46 | - // Which Authentication, Storage and HTTP IO classes to use. |
|
| 47 | - 'auth_class' => 'Google_Auth_OAuth2', |
|
| 48 | - 'io_class' => self::USE_AUTO_IO_SELECTION, |
|
| 49 | - 'cache_class' => 'Google_Cache_File', |
|
| 50 | - 'logger_class' => 'Google_Logger_Null', |
|
| 51 | - |
|
| 52 | - // Don't change these unless you're working against a special development |
|
| 53 | - // or testing environment. |
|
| 54 | - 'base_path' => 'https://www.googleapis.com', |
|
| 55 | - |
|
| 56 | - // Definition of class specific values, like file paths and so on. |
|
| 57 | - 'classes' => array( |
|
| 58 | - 'Google_IO_Abstract' => array( |
|
| 59 | - 'request_timeout_seconds' => 100, |
|
| 60 | - ), |
|
| 61 | - 'Google_Logger_Abstract' => array( |
|
| 62 | - 'level' => 'debug', |
|
| 63 | - 'log_format' => "[%datetime%] %level%: %message% %context%\n", |
|
| 64 | - 'date_format' => 'd/M/Y:H:i:s O', |
|
| 65 | - 'allow_newlines' => true |
|
| 66 | - ), |
|
| 67 | - 'Google_Logger_File' => array( |
|
| 68 | - 'file' => 'php://stdout', |
|
| 69 | - 'mode' => 0640, |
|
| 70 | - 'lock' => false, |
|
| 71 | - ), |
|
| 72 | - 'Google_Http_Request' => array( |
|
| 73 | - // Disable the use of gzip on calls if set to true. Defaults to false. |
|
| 74 | - 'disable_gzip' => self::GZIP_ENABLED, |
|
| 75 | - |
|
| 76 | - // We default gzip to disabled on uploads even if gzip is otherwise |
|
| 77 | - // enabled, due to some issues seen with small packet sizes for uploads. |
|
| 78 | - // Please test with this option before enabling gzip for uploads in |
|
| 79 | - // a production environment. |
|
| 80 | - 'enable_gzip_for_uploads' => self::GZIP_UPLOADS_DISABLED, |
|
| 81 | - ), |
|
| 82 | - // If you want to pass in OAuth 2.0 settings, they will need to be |
|
| 83 | - // structured like this. |
|
| 84 | - 'Google_Auth_OAuth2' => array( |
|
| 85 | - // Keys for OAuth 2.0 access, see the API console at |
|
| 86 | - // https://developers.google.com/console |
|
| 87 | - 'client_id' => '', |
|
| 88 | - 'client_secret' => '', |
|
| 89 | - 'redirect_uri' => '', |
|
| 90 | - |
|
| 91 | - // Simple API access key, also from the API console. Ensure you get |
|
| 92 | - // a Server key, and not a Browser key. |
|
| 93 | - 'developer_key' => '', |
|
| 94 | - |
|
| 95 | - // Other parameters. |
|
| 96 | - 'hd' => '', |
|
| 97 | - 'prompt' => '', |
|
| 98 | - 'openid.realm' => '', |
|
| 99 | - 'include_granted_scopes' => '', |
|
| 100 | - 'login_hint' => '', |
|
| 101 | - 'request_visible_actions' => '', |
|
| 102 | - 'access_type' => 'online', |
|
| 103 | - 'approval_prompt' => 'auto', |
|
| 104 | - 'federated_signon_certs_url' => |
|
| 105 | - 'https://www.googleapis.com/oauth2/v1/certs', |
|
| 106 | - ), |
|
| 107 | - 'Google_Task_Runner' => array( |
|
| 108 | - // Delays are specified in seconds |
|
| 109 | - 'initial_delay' => 1, |
|
| 110 | - 'max_delay' => 60, |
|
| 111 | - // Base number for exponential backoff |
|
| 112 | - 'factor' => 2, |
|
| 113 | - // A random number between -jitter and jitter will be added to the |
|
| 114 | - // factor on each iteration to allow for better distribution of |
|
| 115 | - // retries. |
|
| 116 | - 'jitter' => .5, |
|
| 117 | - // Maximum number of retries allowed |
|
| 118 | - 'retries' => 0 |
|
| 119 | - ), |
|
| 120 | - 'Google_Service_Exception' => array( |
|
| 121 | - 'retry_map' => array( |
|
| 122 | - '500' => self::TASK_RETRY_ALWAYS, |
|
| 123 | - '503' => self::TASK_RETRY_ALWAYS, |
|
| 124 | - 'rateLimitExceeded' => self::TASK_RETRY_ALWAYS, |
|
| 125 | - 'userRateLimitExceeded' => self::TASK_RETRY_ALWAYS |
|
| 126 | - ) |
|
| 127 | - ), |
|
| 128 | - 'Google_IO_Exception' => array( |
|
| 129 | - 'retry_map' => !extension_loaded('curl') ? array() : array( |
|
| 130 | - CURLE_COULDNT_RESOLVE_HOST => self::TASK_RETRY_ALWAYS, |
|
| 131 | - CURLE_COULDNT_CONNECT => self::TASK_RETRY_ALWAYS, |
|
| 132 | - CURLE_OPERATION_TIMEOUTED => self::TASK_RETRY_ALWAYS, |
|
| 133 | - CURLE_SSL_CONNECT_ERROR => self::TASK_RETRY_ALWAYS, |
|
| 134 | - CURLE_GOT_NOTHING => self::TASK_RETRY_ALWAYS |
|
| 135 | - ) |
|
| 136 | - ), |
|
| 137 | - // Set a default directory for the file cache. |
|
| 138 | - 'Google_Cache_File' => array( |
|
| 139 | - 'directory' => sys_get_temp_dir() . '/Google_Client' |
|
| 140 | - ) |
|
| 141 | - ), |
|
| 142 | - ); |
|
| 143 | - if ($ini_file_location) { |
|
| 144 | - $ini = parse_ini_file($ini_file_location, true); |
|
| 145 | - if (is_array($ini) && count($ini)) { |
|
| 146 | - $merged_configuration = $ini + $this->configuration; |
|
| 147 | - if (isset($ini['classes']) && isset($this->configuration['classes'])) { |
|
| 148 | - $merged_configuration['classes'] = $ini['classes'] + $this->configuration['classes']; |
|
| 149 | - } |
|
| 150 | - $this->configuration = $merged_configuration; |
|
| 151 | - } |
|
| 152 | - } |
|
| 42 | + $this->configuration = array( |
|
| 43 | + // The application_name is included in the User-Agent HTTP header. |
|
| 44 | + 'application_name' => '', |
|
| 45 | + |
|
| 46 | + // Which Authentication, Storage and HTTP IO classes to use. |
|
| 47 | + 'auth_class' => 'Google_Auth_OAuth2', |
|
| 48 | + 'io_class' => self::USE_AUTO_IO_SELECTION, |
|
| 49 | + 'cache_class' => 'Google_Cache_File', |
|
| 50 | + 'logger_class' => 'Google_Logger_Null', |
|
| 51 | + |
|
| 52 | + // Don't change these unless you're working against a special development |
|
| 53 | + // or testing environment. |
|
| 54 | + 'base_path' => 'https://www.googleapis.com', |
|
| 55 | + |
|
| 56 | + // Definition of class specific values, like file paths and so on. |
|
| 57 | + 'classes' => array( |
|
| 58 | + 'Google_IO_Abstract' => array( |
|
| 59 | + 'request_timeout_seconds' => 100, |
|
| 60 | + ), |
|
| 61 | + 'Google_Logger_Abstract' => array( |
|
| 62 | + 'level' => 'debug', |
|
| 63 | + 'log_format' => "[%datetime%] %level%: %message% %context%\n", |
|
| 64 | + 'date_format' => 'd/M/Y:H:i:s O', |
|
| 65 | + 'allow_newlines' => true |
|
| 66 | + ), |
|
| 67 | + 'Google_Logger_File' => array( |
|
| 68 | + 'file' => 'php://stdout', |
|
| 69 | + 'mode' => 0640, |
|
| 70 | + 'lock' => false, |
|
| 71 | + ), |
|
| 72 | + 'Google_Http_Request' => array( |
|
| 73 | + // Disable the use of gzip on calls if set to true. Defaults to false. |
|
| 74 | + 'disable_gzip' => self::GZIP_ENABLED, |
|
| 75 | + |
|
| 76 | + // We default gzip to disabled on uploads even if gzip is otherwise |
|
| 77 | + // enabled, due to some issues seen with small packet sizes for uploads. |
|
| 78 | + // Please test with this option before enabling gzip for uploads in |
|
| 79 | + // a production environment. |
|
| 80 | + 'enable_gzip_for_uploads' => self::GZIP_UPLOADS_DISABLED, |
|
| 81 | + ), |
|
| 82 | + // If you want to pass in OAuth 2.0 settings, they will need to be |
|
| 83 | + // structured like this. |
|
| 84 | + 'Google_Auth_OAuth2' => array( |
|
| 85 | + // Keys for OAuth 2.0 access, see the API console at |
|
| 86 | + // https://developers.google.com/console |
|
| 87 | + 'client_id' => '', |
|
| 88 | + 'client_secret' => '', |
|
| 89 | + 'redirect_uri' => '', |
|
| 90 | + |
|
| 91 | + // Simple API access key, also from the API console. Ensure you get |
|
| 92 | + // a Server key, and not a Browser key. |
|
| 93 | + 'developer_key' => '', |
|
| 94 | + |
|
| 95 | + // Other parameters. |
|
| 96 | + 'hd' => '', |
|
| 97 | + 'prompt' => '', |
|
| 98 | + 'openid.realm' => '', |
|
| 99 | + 'include_granted_scopes' => '', |
|
| 100 | + 'login_hint' => '', |
|
| 101 | + 'request_visible_actions' => '', |
|
| 102 | + 'access_type' => 'online', |
|
| 103 | + 'approval_prompt' => 'auto', |
|
| 104 | + 'federated_signon_certs_url' => |
|
| 105 | + 'https://www.googleapis.com/oauth2/v1/certs', |
|
| 106 | + ), |
|
| 107 | + 'Google_Task_Runner' => array( |
|
| 108 | + // Delays are specified in seconds |
|
| 109 | + 'initial_delay' => 1, |
|
| 110 | + 'max_delay' => 60, |
|
| 111 | + // Base number for exponential backoff |
|
| 112 | + 'factor' => 2, |
|
| 113 | + // A random number between -jitter and jitter will be added to the |
|
| 114 | + // factor on each iteration to allow for better distribution of |
|
| 115 | + // retries. |
|
| 116 | + 'jitter' => .5, |
|
| 117 | + // Maximum number of retries allowed |
|
| 118 | + 'retries' => 0 |
|
| 119 | + ), |
|
| 120 | + 'Google_Service_Exception' => array( |
|
| 121 | + 'retry_map' => array( |
|
| 122 | + '500' => self::TASK_RETRY_ALWAYS, |
|
| 123 | + '503' => self::TASK_RETRY_ALWAYS, |
|
| 124 | + 'rateLimitExceeded' => self::TASK_RETRY_ALWAYS, |
|
| 125 | + 'userRateLimitExceeded' => self::TASK_RETRY_ALWAYS |
|
| 126 | + ) |
|
| 127 | + ), |
|
| 128 | + 'Google_IO_Exception' => array( |
|
| 129 | + 'retry_map' => !extension_loaded('curl') ? array() : array( |
|
| 130 | + CURLE_COULDNT_RESOLVE_HOST => self::TASK_RETRY_ALWAYS, |
|
| 131 | + CURLE_COULDNT_CONNECT => self::TASK_RETRY_ALWAYS, |
|
| 132 | + CURLE_OPERATION_TIMEOUTED => self::TASK_RETRY_ALWAYS, |
|
| 133 | + CURLE_SSL_CONNECT_ERROR => self::TASK_RETRY_ALWAYS, |
|
| 134 | + CURLE_GOT_NOTHING => self::TASK_RETRY_ALWAYS |
|
| 135 | + ) |
|
| 136 | + ), |
|
| 137 | + // Set a default directory for the file cache. |
|
| 138 | + 'Google_Cache_File' => array( |
|
| 139 | + 'directory' => sys_get_temp_dir() . '/Google_Client' |
|
| 140 | + ) |
|
| 141 | + ), |
|
| 142 | + ); |
|
| 143 | + if ($ini_file_location) { |
|
| 144 | + $ini = parse_ini_file($ini_file_location, true); |
|
| 145 | + if (is_array($ini) && count($ini)) { |
|
| 146 | + $merged_configuration = $ini + $this->configuration; |
|
| 147 | + if (isset($ini['classes']) && isset($this->configuration['classes'])) { |
|
| 148 | + $merged_configuration['classes'] = $ini['classes'] + $this->configuration['classes']; |
|
| 149 | + } |
|
| 150 | + $this->configuration = $merged_configuration; |
|
| 151 | + } |
|
| 152 | + } |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | /** |
@@ -162,26 +162,26 @@ discard block |
||
| 162 | 162 | */ |
| 163 | 163 | public function setClassConfig($class, $config, $value = null) |
| 164 | 164 | { |
| 165 | - if (!is_array($config)) { |
|
| 166 | - if (!isset($this->configuration['classes'][$class])) { |
|
| 167 | - $this->configuration['classes'][$class] = array(); |
|
| 168 | - } |
|
| 169 | - $this->configuration['classes'][$class][$config] = $value; |
|
| 170 | - } else { |
|
| 171 | - $this->configuration['classes'][$class] = $config; |
|
| 172 | - } |
|
| 165 | + if (!is_array($config)) { |
|
| 166 | + if (!isset($this->configuration['classes'][$class])) { |
|
| 167 | + $this->configuration['classes'][$class] = array(); |
|
| 168 | + } |
|
| 169 | + $this->configuration['classes'][$class][$config] = $value; |
|
| 170 | + } else { |
|
| 171 | + $this->configuration['classes'][$class] = $config; |
|
| 172 | + } |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | public function getClassConfig($class, $key = null) |
| 176 | 176 | { |
| 177 | - if (!isset($this->configuration['classes'][$class])) { |
|
| 178 | - return null; |
|
| 179 | - } |
|
| 180 | - if ($key === null) { |
|
| 181 | - return $this->configuration['classes'][$class]; |
|
| 182 | - } else { |
|
| 183 | - return $this->configuration['classes'][$class][$key]; |
|
| 184 | - } |
|
| 177 | + if (!isset($this->configuration['classes'][$class])) { |
|
| 178 | + return null; |
|
| 179 | + } |
|
| 180 | + if ($key === null) { |
|
| 181 | + return $this->configuration['classes'][$class]; |
|
| 182 | + } else { |
|
| 183 | + return $this->configuration['classes'][$class][$key]; |
|
| 184 | + } |
|
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | /** |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | */ |
| 191 | 191 | public function getCacheClass() |
| 192 | 192 | { |
| 193 | - return $this->configuration['cache_class']; |
|
| 193 | + return $this->configuration['cache_class']; |
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | /** |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | */ |
| 200 | 200 | public function getLoggerClass() |
| 201 | 201 | { |
| 202 | - return $this->configuration['logger_class']; |
|
| 202 | + return $this->configuration['logger_class']; |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | /** |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | */ |
| 209 | 209 | public function getAuthClass() |
| 210 | 210 | { |
| 211 | - return $this->configuration['auth_class']; |
|
| 211 | + return $this->configuration['auth_class']; |
|
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | /** |
@@ -218,13 +218,13 @@ discard block |
||
| 218 | 218 | */ |
| 219 | 219 | public function setAuthClass($class) |
| 220 | 220 | { |
| 221 | - $prev = $this->configuration['auth_class']; |
|
| 222 | - if (!isset($this->configuration['classes'][$class]) && |
|
| 223 | - isset($this->configuration['classes'][$prev])) { |
|
| 224 | - $this->configuration['classes'][$class] = |
|
| 225 | - $this->configuration['classes'][$prev]; |
|
| 226 | - } |
|
| 227 | - $this->configuration['auth_class'] = $class; |
|
| 221 | + $prev = $this->configuration['auth_class']; |
|
| 222 | + if (!isset($this->configuration['classes'][$class]) && |
|
| 223 | + isset($this->configuration['classes'][$prev])) { |
|
| 224 | + $this->configuration['classes'][$class] = |
|
| 225 | + $this->configuration['classes'][$prev]; |
|
| 226 | + } |
|
| 227 | + $this->configuration['auth_class'] = $class; |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | /** |
@@ -234,13 +234,13 @@ discard block |
||
| 234 | 234 | */ |
| 235 | 235 | public function setIoClass($class) |
| 236 | 236 | { |
| 237 | - $prev = $this->configuration['io_class']; |
|
| 238 | - if (!isset($this->configuration['classes'][$class]) && |
|
| 239 | - isset($this->configuration['classes'][$prev])) { |
|
| 240 | - $this->configuration['classes'][$class] = |
|
| 241 | - $this->configuration['classes'][$prev]; |
|
| 242 | - } |
|
| 243 | - $this->configuration['io_class'] = $class; |
|
| 237 | + $prev = $this->configuration['io_class']; |
|
| 238 | + if (!isset($this->configuration['classes'][$class]) && |
|
| 239 | + isset($this->configuration['classes'][$prev])) { |
|
| 240 | + $this->configuration['classes'][$class] = |
|
| 241 | + $this->configuration['classes'][$prev]; |
|
| 242 | + } |
|
| 243 | + $this->configuration['io_class'] = $class; |
|
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | /** |
@@ -250,13 +250,13 @@ discard block |
||
| 250 | 250 | */ |
| 251 | 251 | public function setCacheClass($class) |
| 252 | 252 | { |
| 253 | - $prev = $this->configuration['cache_class']; |
|
| 254 | - if (!isset($this->configuration['classes'][$class]) && |
|
| 255 | - isset($this->configuration['classes'][$prev])) { |
|
| 256 | - $this->configuration['classes'][$class] = |
|
| 257 | - $this->configuration['classes'][$prev]; |
|
| 258 | - } |
|
| 259 | - $this->configuration['cache_class'] = $class; |
|
| 253 | + $prev = $this->configuration['cache_class']; |
|
| 254 | + if (!isset($this->configuration['classes'][$class]) && |
|
| 255 | + isset($this->configuration['classes'][$prev])) { |
|
| 256 | + $this->configuration['classes'][$class] = |
|
| 257 | + $this->configuration['classes'][$prev]; |
|
| 258 | + } |
|
| 259 | + $this->configuration['cache_class'] = $class; |
|
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | /** |
@@ -266,13 +266,13 @@ discard block |
||
| 266 | 266 | */ |
| 267 | 267 | public function setLoggerClass($class) |
| 268 | 268 | { |
| 269 | - $prev = $this->configuration['logger_class']; |
|
| 270 | - if (!isset($this->configuration['classes'][$class]) && |
|
| 271 | - isset($this->configuration['classes'][$prev])) { |
|
| 272 | - $this->configuration['classes'][$class] = |
|
| 273 | - $this->configuration['classes'][$prev]; |
|
| 274 | - } |
|
| 275 | - $this->configuration['logger_class'] = $class; |
|
| 269 | + $prev = $this->configuration['logger_class']; |
|
| 270 | + if (!isset($this->configuration['classes'][$class]) && |
|
| 271 | + isset($this->configuration['classes'][$prev])) { |
|
| 272 | + $this->configuration['classes'][$class] = |
|
| 273 | + $this->configuration['classes'][$prev]; |
|
| 274 | + } |
|
| 275 | + $this->configuration['logger_class'] = $class; |
|
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | /** |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | */ |
| 283 | 283 | public function getIoClass() |
| 284 | 284 | { |
| 285 | - return $this->configuration['io_class']; |
|
| 285 | + return $this->configuration['io_class']; |
|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | /** |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | */ |
| 292 | 292 | public function setApplicationName($name) |
| 293 | 293 | { |
| 294 | - $this->configuration['application_name'] = $name; |
|
| 294 | + $this->configuration['application_name'] = $name; |
|
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | /** |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | */ |
| 300 | 300 | public function getApplicationName() |
| 301 | 301 | { |
| 302 | - return $this->configuration['application_name']; |
|
| 302 | + return $this->configuration['application_name']; |
|
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | /** |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | */ |
| 309 | 309 | public function setClientId($clientId) |
| 310 | 310 | { |
| 311 | - $this->setAuthConfig('client_id', $clientId); |
|
| 311 | + $this->setAuthConfig('client_id', $clientId); |
|
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | /** |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | */ |
| 318 | 318 | public function setClientSecret($secret) |
| 319 | 319 | { |
| 320 | - $this->setAuthConfig('client_secret', $secret); |
|
| 320 | + $this->setAuthConfig('client_secret', $secret); |
|
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | /** |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | */ |
| 329 | 329 | public function setRedirectUri($uri) |
| 330 | 330 | { |
| 331 | - $this->setAuthConfig('redirect_uri', $uri); |
|
| 331 | + $this->setAuthConfig('redirect_uri', $uri); |
|
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | /** |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | */ |
| 338 | 338 | public function setRequestVisibleActions($rva) |
| 339 | 339 | { |
| 340 | - $this->setAuthConfig('request_visible_actions', $rva); |
|
| 340 | + $this->setAuthConfig('request_visible_actions', $rva); |
|
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | /** |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | */ |
| 347 | 347 | public function setAccessType($access) |
| 348 | 348 | { |
| 349 | - $this->setAuthConfig('access_type', $access); |
|
| 349 | + $this->setAuthConfig('access_type', $access); |
|
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | /** |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | */ |
| 356 | 356 | public function setApprovalPrompt($approval) |
| 357 | 357 | { |
| 358 | - $this->setAuthConfig('approval_prompt', $approval); |
|
| 358 | + $this->setAuthConfig('approval_prompt', $approval); |
|
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | /** |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | */ |
| 365 | 365 | public function setLoginHint($hint) |
| 366 | 366 | { |
| 367 | - $this->setAuthConfig('login_hint', $hint); |
|
| 367 | + $this->setAuthConfig('login_hint', $hint); |
|
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | /** |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | */ |
| 375 | 375 | public function setDeveloperKey($key) |
| 376 | 376 | { |
| 377 | - $this->setAuthConfig('developer_key', $key); |
|
| 377 | + $this->setAuthConfig('developer_key', $key); |
|
| 378 | 378 | } |
| 379 | 379 | |
| 380 | 380 | /** |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | */ |
| 391 | 391 | public function setHostedDomain($hd) |
| 392 | 392 | { |
| 393 | - $this->setAuthConfig('hd', $hd); |
|
| 393 | + $this->setAuthConfig('hd', $hd); |
|
| 394 | 394 | } |
| 395 | 395 | |
| 396 | 396 | /** |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | */ |
| 402 | 402 | public function setPrompt($prompt) |
| 403 | 403 | { |
| 404 | - $this->setAuthConfig('prompt', $prompt); |
|
| 404 | + $this->setAuthConfig('prompt', $prompt); |
|
| 405 | 405 | } |
| 406 | 406 | |
| 407 | 407 | /** |
@@ -412,7 +412,7 @@ discard block |
||
| 412 | 412 | */ |
| 413 | 413 | public function setOpenidRealm($realm) |
| 414 | 414 | { |
| 415 | - $this->setAuthConfig('openid.realm', $realm); |
|
| 415 | + $this->setAuthConfig('openid.realm', $realm); |
|
| 416 | 416 | } |
| 417 | 417 | |
| 418 | 418 | /** |
@@ -423,10 +423,10 @@ discard block |
||
| 423 | 423 | */ |
| 424 | 424 | public function setIncludeGrantedScopes($include) |
| 425 | 425 | { |
| 426 | - $this->setAuthConfig( |
|
| 427 | - 'include_granted_scopes', |
|
| 428 | - $include ? "true" : "false" |
|
| 429 | - ); |
|
| 426 | + $this->setAuthConfig( |
|
| 427 | + 'include_granted_scopes', |
|
| 428 | + $include ? "true" : "false" |
|
| 429 | + ); |
|
| 430 | 430 | } |
| 431 | 431 | |
| 432 | 432 | /** |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | */ |
| 435 | 435 | public function getBasePath() |
| 436 | 436 | { |
| 437 | - return $this->configuration['base_path']; |
|
| 437 | + return $this->configuration['base_path']; |
|
| 438 | 438 | } |
| 439 | 439 | |
| 440 | 440 | /** |
@@ -444,9 +444,9 @@ discard block |
||
| 444 | 444 | */ |
| 445 | 445 | private function setAuthConfig($key, $value) |
| 446 | 446 | { |
| 447 | - if (!isset($this->configuration['classes'][$this->getAuthClass()])) { |
|
| 448 | - $this->configuration['classes'][$this->getAuthClass()] = array(); |
|
| 449 | - } |
|
| 450 | - $this->configuration['classes'][$this->getAuthClass()][$key] = $value; |
|
| 447 | + if (!isset($this->configuration['classes'][$this->getAuthClass()])) { |
|
| 448 | + $this->configuration['classes'][$this->getAuthClass()] = array(); |
|
| 449 | + } |
|
| 450 | + $this->configuration['classes'][$this->getAuthClass()][$key] = $value; |
|
| 451 | 451 | } |
| 452 | 452 | } |
@@ -136,7 +136,7 @@ |
||
| 136 | 136 | ), |
| 137 | 137 | // Set a default directory for the file cache. |
| 138 | 138 | 'Google_Cache_File' => array( |
| 139 | - 'directory' => sys_get_temp_dir() . '/Google_Client' |
|
| 139 | + 'directory' => sys_get_temp_dir().'/Google_Client' |
|
| 140 | 140 | ) |
| 141 | 141 | ), |
| 142 | 142 | ); |
@@ -16,17 +16,17 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | |
| 18 | 18 | spl_autoload_register( |
| 19 | - function ($className) { |
|
| 20 | - $classPath = explode('_', $className); |
|
| 21 | - if ($classPath[0] != 'Google') { |
|
| 22 | - return; |
|
| 23 | - } |
|
| 24 | - // Drop 'Google', and maximum class file path depth in this project is 3. |
|
| 25 | - $classPath = array_slice($classPath, 1, 2); |
|
| 19 | + function ($className) { |
|
| 20 | + $classPath = explode('_', $className); |
|
| 21 | + if ($classPath[0] != 'Google') { |
|
| 22 | + return; |
|
| 23 | + } |
|
| 24 | + // Drop 'Google', and maximum class file path depth in this project is 3. |
|
| 25 | + $classPath = array_slice($classPath, 1, 2); |
|
| 26 | 26 | |
| 27 | - $filePath = dirname(__FILE__) . '/' . implode('/', $classPath) . '.php'; |
|
| 28 | - if (file_exists($filePath)) { |
|
| 29 | - require_once($filePath); |
|
| 30 | - } |
|
| 31 | - } |
|
| 27 | + $filePath = dirname(__FILE__) . '/' . implode('/', $classPath) . '.php'; |
|
| 28 | + if (file_exists($filePath)) { |
|
| 29 | + require_once($filePath); |
|
| 30 | + } |
|
| 31 | + } |
|
| 32 | 32 | ); |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | |
| 18 | 18 | spl_autoload_register( |
| 19 | - function ($className) { |
|
| 19 | + function($className) { |
|
| 20 | 20 | $classPath = explode('_', $className); |
| 21 | 21 | if ($classPath[0] != 'Google') { |
| 22 | 22 | return; |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | // Drop 'Google', and maximum class file path depth in this project is 3. |
| 25 | 25 | $classPath = array_slice($classPath, 1, 2); |
| 26 | 26 | |
| 27 | - $filePath = dirname(__FILE__) . '/' . implode('/', $classPath) . '.php'; |
|
| 27 | + $filePath = dirname(__FILE__).'/'.implode('/', $classPath).'.php'; |
|
| 28 | 28 | if (file_exists($filePath)) { |
| 29 | 29 | require_once($filePath); |
| 30 | 30 | } |
@@ -38,11 +38,11 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | public function __construct(Google_Client $client, /*Psr\Log\LoggerInterface*/ $logger = null) |
| 40 | 40 | { |
| 41 | - parent::__construct($client); |
|
| 41 | + parent::__construct($client); |
|
| 42 | 42 | |
| 43 | - if ($logger) { |
|
| 44 | - $this->setLogger($logger); |
|
| 45 | - } |
|
| 43 | + if ($logger) { |
|
| 44 | + $this->setLogger($logger); |
|
| 45 | + } |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /** |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | public function setLogger(/*Psr\Log\LoggerInterface*/ $logger) |
| 58 | 58 | { |
| 59 | - $this->logger = $logger; |
|
| 59 | + $this->logger = $logger; |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /** |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public function shouldHandle($level) |
| 66 | 66 | { |
| 67 | - return isset($this->logger) && parent::shouldHandle($level); |
|
| 67 | + return isset($this->logger) && parent::shouldHandle($level); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -72,16 +72,16 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | public function log($level, $message, array $context = array()) |
| 74 | 74 | { |
| 75 | - if (!$this->shouldHandle($level)) { |
|
| 76 | - return false; |
|
| 77 | - } |
|
| 75 | + if (!$this->shouldHandle($level)) { |
|
| 76 | + return false; |
|
| 77 | + } |
|
| 78 | 78 | |
| 79 | - if ($context) { |
|
| 80 | - $this->reverseJsonInContext($context); |
|
| 81 | - } |
|
| 79 | + if ($context) { |
|
| 80 | + $this->reverseJsonInContext($context); |
|
| 81 | + } |
|
| 82 | 82 | |
| 83 | - $levelName = is_int($level) ? array_search($level, self::$levels) : $level; |
|
| 84 | - $this->logger->log($levelName, $message, $context); |
|
| 83 | + $levelName = is_int($level) ? array_search($level, self::$levels) : $level; |
|
| 84 | + $this->logger->log($levelName, $message, $context); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | |
| 18 | 18 | if (!class_exists('Google_Client')) { |
| 19 | - require_once dirname(__FILE__) . '/../autoload.php'; |
|
| 19 | + require_once dirname(__FILE__).'/../autoload.php'; |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | /** |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | public function shouldHandle($level) |
| 33 | 33 | { |
| 34 | - return false; |
|
| 34 | + return false; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | |
| 18 | 18 | if (!class_exists('Google_Client')) { |
| 19 | - require_once dirname(__FILE__) . '/../autoload.php'; |
|
| 19 | + require_once dirname(__FILE__).'/../autoload.php'; |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | /** |
@@ -53,22 +53,22 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function __construct(Google_Client $client) |
| 55 | 55 | { |
| 56 | - parent::__construct($client); |
|
| 57 | - |
|
| 58 | - $file = $client->getClassConfig('Google_Logger_File', 'file'); |
|
| 59 | - if (!is_string($file) && !is_resource($file)) { |
|
| 60 | - throw new Google_Logger_Exception( |
|
| 61 | - 'File logger requires a filename or a valid file pointer' |
|
| 62 | - ); |
|
| 63 | - } |
|
| 64 | - |
|
| 65 | - $mode = $client->getClassConfig('Google_Logger_File', 'mode'); |
|
| 66 | - if (!$mode) { |
|
| 67 | - $this->mode = $mode; |
|
| 68 | - } |
|
| 69 | - |
|
| 70 | - $this->lock = (bool) $client->getClassConfig('Google_Logger_File', 'lock'); |
|
| 71 | - $this->file = $file; |
|
| 56 | + parent::__construct($client); |
|
| 57 | + |
|
| 58 | + $file = $client->getClassConfig('Google_Logger_File', 'file'); |
|
| 59 | + if (!is_string($file) && !is_resource($file)) { |
|
| 60 | + throw new Google_Logger_Exception( |
|
| 61 | + 'File logger requires a filename or a valid file pointer' |
|
| 62 | + ); |
|
| 63 | + } |
|
| 64 | + |
|
| 65 | + $mode = $client->getClassConfig('Google_Logger_File', 'mode'); |
|
| 66 | + if (!$mode) { |
|
| 67 | + $this->mode = $mode; |
|
| 68 | + } |
|
| 69 | + |
|
| 70 | + $this->lock = (bool) $client->getClassConfig('Google_Logger_File', 'lock'); |
|
| 71 | + $this->file = $file; |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
@@ -76,21 +76,21 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | protected function write($message) |
| 78 | 78 | { |
| 79 | - if (is_string($this->file)) { |
|
| 80 | - $this->open(); |
|
| 81 | - } elseif (!is_resource($this->file)) { |
|
| 82 | - throw new Google_Logger_Exception('File pointer is no longer available'); |
|
| 83 | - } |
|
| 79 | + if (is_string($this->file)) { |
|
| 80 | + $this->open(); |
|
| 81 | + } elseif (!is_resource($this->file)) { |
|
| 82 | + throw new Google_Logger_Exception('File pointer is no longer available'); |
|
| 83 | + } |
|
| 84 | 84 | |
| 85 | - if ($this->lock) { |
|
| 86 | - flock($this->file, LOCK_EX); |
|
| 87 | - } |
|
| 85 | + if ($this->lock) { |
|
| 86 | + flock($this->file, LOCK_EX); |
|
| 87 | + } |
|
| 88 | 88 | |
| 89 | - fwrite($this->file, (string) $message); |
|
| 89 | + fwrite($this->file, (string) $message); |
|
| 90 | 90 | |
| 91 | - if ($this->lock) { |
|
| 92 | - flock($this->file, LOCK_UN); |
|
| 93 | - } |
|
| 91 | + if ($this->lock) { |
|
| 92 | + flock($this->file, LOCK_UN); |
|
| 93 | + } |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /** |
@@ -100,33 +100,33 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | private function open() |
| 102 | 102 | { |
| 103 | - // Used for trapping `fopen()` errors. |
|
| 104 | - $this->trappedErrorNumber = null; |
|
| 105 | - $this->trappedErrorString = null; |
|
| 103 | + // Used for trapping `fopen()` errors. |
|
| 104 | + $this->trappedErrorNumber = null; |
|
| 105 | + $this->trappedErrorString = null; |
|
| 106 | 106 | |
| 107 | - $old = set_error_handler(array($this, 'trapError')); |
|
| 107 | + $old = set_error_handler(array($this, 'trapError')); |
|
| 108 | 108 | |
| 109 | - $needsChmod = !file_exists($this->file); |
|
| 110 | - $fh = fopen($this->file, 'a'); |
|
| 109 | + $needsChmod = !file_exists($this->file); |
|
| 110 | + $fh = fopen($this->file, 'a'); |
|
| 111 | 111 | |
| 112 | - restore_error_handler(); |
|
| 112 | + restore_error_handler(); |
|
| 113 | 113 | |
| 114 | - // Handles trapped `fopen()` errors. |
|
| 115 | - if ($this->trappedErrorNumber) { |
|
| 116 | - throw new Google_Logger_Exception( |
|
| 117 | - sprintf( |
|
| 118 | - "Logger Error: '%s'", |
|
| 119 | - $this->trappedErrorString |
|
| 120 | - ), |
|
| 121 | - $this->trappedErrorNumber |
|
| 122 | - ); |
|
| 123 | - } |
|
| 114 | + // Handles trapped `fopen()` errors. |
|
| 115 | + if ($this->trappedErrorNumber) { |
|
| 116 | + throw new Google_Logger_Exception( |
|
| 117 | + sprintf( |
|
| 118 | + "Logger Error: '%s'", |
|
| 119 | + $this->trappedErrorString |
|
| 120 | + ), |
|
| 121 | + $this->trappedErrorNumber |
|
| 122 | + ); |
|
| 123 | + } |
|
| 124 | 124 | |
| 125 | - if ($needsChmod) { |
|
| 126 | - @chmod($this->file, $this->mode & ~umask()); |
|
| 127 | - } |
|
| 125 | + if ($needsChmod) { |
|
| 126 | + @chmod($this->file, $this->mode & ~umask()); |
|
| 127 | + } |
|
| 128 | 128 | |
| 129 | - return $this->file = $fh; |
|
| 129 | + return $this->file = $fh; |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | /** |
@@ -134,9 +134,9 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | private function close() |
| 136 | 136 | { |
| 137 | - if (is_resource($this->file)) { |
|
| 138 | - fclose($this->file); |
|
| 139 | - } |
|
| 137 | + if (is_resource($this->file)) { |
|
| 138 | + fclose($this->file); |
|
| 139 | + } |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /** |
@@ -147,12 +147,12 @@ discard block |
||
| 147 | 147 | */ |
| 148 | 148 | private function trapError($errno, $errstr) |
| 149 | 149 | { |
| 150 | - $this->trappedErrorNumber = $errno; |
|
| 151 | - $this->trappedErrorString = $errstr; |
|
| 150 | + $this->trappedErrorNumber = $errno; |
|
| 151 | + $this->trappedErrorString = $errstr; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | public function __destruct() |
| 155 | 155 | { |
| 156 | - $this->close(); |
|
| 156 | + $this->close(); |
|
| 157 | 157 | } |
| 158 | 158 | } |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | |
| 18 | 18 | if (!class_exists('Google_Client')) { |
| 19 | - require_once dirname(__FILE__) . '/../autoload.php'; |
|
| 19 | + require_once dirname(__FILE__).'/../autoload.php'; |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | /** |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | |
| 18 | 18 | if (!class_exists('Google_Client')) { |
| 19 | - require_once dirname(__FILE__) . '/../autoload.php'; |
|
| 19 | + require_once dirname(__FILE__).'/../autoload.php'; |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | class Google_Logger_Exception extends Google_Exception |
@@ -43,11 +43,11 @@ |
||
| 43 | 43 | */ |
| 44 | 44 | public function __construct(Google_Client $client) |
| 45 | 45 | { |
| 46 | - parent::__construct($client); |
|
| 47 | - $this->rootUrl = 'https://playmoviespartner.googleapis.com/'; |
|
| 48 | - $this->servicePath = ''; |
|
| 49 | - $this->version = 'v1'; |
|
| 50 | - $this->serviceName = 'playmoviespartner'; |
|
| 46 | + parent::__construct($client); |
|
| 47 | + $this->rootUrl = 'https://playmoviespartner.googleapis.com/'; |
|
| 48 | + $this->servicePath = ''; |
|
| 49 | + $this->version = 'v1'; |
|
| 50 | + $this->serviceName = 'playmoviespartner'; |
|
| 51 | 51 | |
| 52 | 52 | } |
| 53 | 53 | } |
@@ -44,10 +44,10 @@ |
||
| 44 | 44 | */ |
| 45 | 45 | public function __construct(Google_Client $client) |
| 46 | 46 | { |
| 47 | - parent::__construct($client); |
|
| 48 | - $this->servicePath = ''; |
|
| 49 | - $this->version = 'v1'; |
|
| 50 | - $this->serviceName = 'cloudsearch'; |
|
| 47 | + parent::__construct($client); |
|
| 48 | + $this->servicePath = ''; |
|
| 49 | + $this->version = 'v1'; |
|
| 50 | + $this->serviceName = 'cloudsearch'; |
|
| 51 | 51 | |
| 52 | 52 | } |
| 53 | 53 | } |
@@ -44,91 +44,91 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function __construct(Google_Client $client) |
| 46 | 46 | { |
| 47 | - parent::__construct($client); |
|
| 48 | - $this->rootUrl = 'https://www.googleapis.com/'; |
|
| 49 | - $this->servicePath = 'language/translate/'; |
|
| 50 | - $this->version = 'v2'; |
|
| 51 | - $this->serviceName = 'translate'; |
|
| 52 | - |
|
| 53 | - $this->detections = new Google_Service_Translate_Detections_Resource( |
|
| 54 | - $this, |
|
| 55 | - $this->serviceName, |
|
| 56 | - 'detections', |
|
| 57 | - array( |
|
| 58 | - 'methods' => array( |
|
| 59 | - 'list' => array( |
|
| 60 | - 'path' => 'v2/detect', |
|
| 61 | - 'httpMethod' => 'GET', |
|
| 62 | - 'parameters' => array( |
|
| 63 | - 'q' => array( |
|
| 64 | - 'location' => 'query', |
|
| 65 | - 'type' => 'string', |
|
| 66 | - 'repeated' => true, |
|
| 67 | - 'required' => true, |
|
| 68 | - ), |
|
| 69 | - ), |
|
| 70 | - ), |
|
| 71 | - ) |
|
| 72 | - ) |
|
| 73 | - ); |
|
| 74 | - $this->languages = new Google_Service_Translate_Languages_Resource( |
|
| 75 | - $this, |
|
| 76 | - $this->serviceName, |
|
| 77 | - 'languages', |
|
| 78 | - array( |
|
| 79 | - 'methods' => array( |
|
| 80 | - 'list' => array( |
|
| 81 | - 'path' => 'v2/languages', |
|
| 82 | - 'httpMethod' => 'GET', |
|
| 83 | - 'parameters' => array( |
|
| 84 | - 'target' => array( |
|
| 85 | - 'location' => 'query', |
|
| 86 | - 'type' => 'string', |
|
| 87 | - ), |
|
| 88 | - ), |
|
| 89 | - ), |
|
| 90 | - ) |
|
| 91 | - ) |
|
| 92 | - ); |
|
| 93 | - $this->translations = new Google_Service_Translate_Translations_Resource( |
|
| 94 | - $this, |
|
| 95 | - $this->serviceName, |
|
| 96 | - 'translations', |
|
| 97 | - array( |
|
| 98 | - 'methods' => array( |
|
| 99 | - 'list' => array( |
|
| 100 | - 'path' => 'v2', |
|
| 101 | - 'httpMethod' => 'GET', |
|
| 102 | - 'parameters' => array( |
|
| 103 | - 'q' => array( |
|
| 104 | - 'location' => 'query', |
|
| 105 | - 'type' => 'string', |
|
| 106 | - 'repeated' => true, |
|
| 107 | - 'required' => true, |
|
| 108 | - ), |
|
| 109 | - 'target' => array( |
|
| 110 | - 'location' => 'query', |
|
| 111 | - 'type' => 'string', |
|
| 112 | - 'required' => true, |
|
| 113 | - ), |
|
| 114 | - 'source' => array( |
|
| 115 | - 'location' => 'query', |
|
| 116 | - 'type' => 'string', |
|
| 117 | - ), |
|
| 118 | - 'format' => array( |
|
| 119 | - 'location' => 'query', |
|
| 120 | - 'type' => 'string', |
|
| 121 | - ), |
|
| 122 | - 'cid' => array( |
|
| 123 | - 'location' => 'query', |
|
| 124 | - 'type' => 'string', |
|
| 125 | - 'repeated' => true, |
|
| 126 | - ), |
|
| 127 | - ), |
|
| 128 | - ), |
|
| 129 | - ) |
|
| 130 | - ) |
|
| 131 | - ); |
|
| 47 | + parent::__construct($client); |
|
| 48 | + $this->rootUrl = 'https://www.googleapis.com/'; |
|
| 49 | + $this->servicePath = 'language/translate/'; |
|
| 50 | + $this->version = 'v2'; |
|
| 51 | + $this->serviceName = 'translate'; |
|
| 52 | + |
|
| 53 | + $this->detections = new Google_Service_Translate_Detections_Resource( |
|
| 54 | + $this, |
|
| 55 | + $this->serviceName, |
|
| 56 | + 'detections', |
|
| 57 | + array( |
|
| 58 | + 'methods' => array( |
|
| 59 | + 'list' => array( |
|
| 60 | + 'path' => 'v2/detect', |
|
| 61 | + 'httpMethod' => 'GET', |
|
| 62 | + 'parameters' => array( |
|
| 63 | + 'q' => array( |
|
| 64 | + 'location' => 'query', |
|
| 65 | + 'type' => 'string', |
|
| 66 | + 'repeated' => true, |
|
| 67 | + 'required' => true, |
|
| 68 | + ), |
|
| 69 | + ), |
|
| 70 | + ), |
|
| 71 | + ) |
|
| 72 | + ) |
|
| 73 | + ); |
|
| 74 | + $this->languages = new Google_Service_Translate_Languages_Resource( |
|
| 75 | + $this, |
|
| 76 | + $this->serviceName, |
|
| 77 | + 'languages', |
|
| 78 | + array( |
|
| 79 | + 'methods' => array( |
|
| 80 | + 'list' => array( |
|
| 81 | + 'path' => 'v2/languages', |
|
| 82 | + 'httpMethod' => 'GET', |
|
| 83 | + 'parameters' => array( |
|
| 84 | + 'target' => array( |
|
| 85 | + 'location' => 'query', |
|
| 86 | + 'type' => 'string', |
|
| 87 | + ), |
|
| 88 | + ), |
|
| 89 | + ), |
|
| 90 | + ) |
|
| 91 | + ) |
|
| 92 | + ); |
|
| 93 | + $this->translations = new Google_Service_Translate_Translations_Resource( |
|
| 94 | + $this, |
|
| 95 | + $this->serviceName, |
|
| 96 | + 'translations', |
|
| 97 | + array( |
|
| 98 | + 'methods' => array( |
|
| 99 | + 'list' => array( |
|
| 100 | + 'path' => 'v2', |
|
| 101 | + 'httpMethod' => 'GET', |
|
| 102 | + 'parameters' => array( |
|
| 103 | + 'q' => array( |
|
| 104 | + 'location' => 'query', |
|
| 105 | + 'type' => 'string', |
|
| 106 | + 'repeated' => true, |
|
| 107 | + 'required' => true, |
|
| 108 | + ), |
|
| 109 | + 'target' => array( |
|
| 110 | + 'location' => 'query', |
|
| 111 | + 'type' => 'string', |
|
| 112 | + 'required' => true, |
|
| 113 | + ), |
|
| 114 | + 'source' => array( |
|
| 115 | + 'location' => 'query', |
|
| 116 | + 'type' => 'string', |
|
| 117 | + ), |
|
| 118 | + 'format' => array( |
|
| 119 | + 'location' => 'query', |
|
| 120 | + 'type' => 'string', |
|
| 121 | + ), |
|
| 122 | + 'cid' => array( |
|
| 123 | + 'location' => 'query', |
|
| 124 | + 'type' => 'string', |
|
| 125 | + 'repeated' => true, |
|
| 126 | + ), |
|
| 127 | + ), |
|
| 128 | + ), |
|
| 129 | + ) |
|
| 130 | + ) |
|
| 131 | + ); |
|
| 132 | 132 | } |
| 133 | 133 | } |
| 134 | 134 | |
@@ -153,9 +153,9 @@ discard block |
||
| 153 | 153 | */ |
| 154 | 154 | public function listDetections($q, $optParams = array()) |
| 155 | 155 | { |
| 156 | - $params = array('q' => $q); |
|
| 157 | - $params = array_merge($params, $optParams); |
|
| 158 | - return $this->call('list', array($params), "Google_Service_Translate_DetectionsListResponse"); |
|
| 156 | + $params = array('q' => $q); |
|
| 157 | + $params = array_merge($params, $optParams); |
|
| 158 | + return $this->call('list', array($params), "Google_Service_Translate_DetectionsListResponse"); |
|
| 159 | 159 | } |
| 160 | 160 | } |
| 161 | 161 | |
@@ -182,9 +182,9 @@ discard block |
||
| 182 | 182 | */ |
| 183 | 183 | public function listLanguages($optParams = array()) |
| 184 | 184 | { |
| 185 | - $params = array(); |
|
| 186 | - $params = array_merge($params, $optParams); |
|
| 187 | - return $this->call('list', array($params), "Google_Service_Translate_LanguagesListResponse"); |
|
| 185 | + $params = array(); |
|
| 186 | + $params = array_merge($params, $optParams); |
|
| 187 | + return $this->call('list', array($params), "Google_Service_Translate_LanguagesListResponse"); |
|
| 188 | 188 | } |
| 189 | 189 | } |
| 190 | 190 | |
@@ -215,9 +215,9 @@ discard block |
||
| 215 | 215 | */ |
| 216 | 216 | public function listTranslations($q, $target, $optParams = array()) |
| 217 | 217 | { |
| 218 | - $params = array('q' => $q, 'target' => $target); |
|
| 219 | - $params = array_merge($params, $optParams); |
|
| 220 | - return $this->call('list', array($params), "Google_Service_Translate_TranslationsListResponse"); |
|
| 218 | + $params = array('q' => $q, 'target' => $target); |
|
| 219 | + $params = array_merge($params, $optParams); |
|
| 220 | + return $this->call('list', array($params), "Google_Service_Translate_TranslationsListResponse"); |
|
| 221 | 221 | } |
| 222 | 222 | } |
| 223 | 223 | |
@@ -235,11 +235,11 @@ discard block |
||
| 235 | 235 | |
| 236 | 236 | public function setDetections($detections) |
| 237 | 237 | { |
| 238 | - $this->detections = $detections; |
|
| 238 | + $this->detections = $detections; |
|
| 239 | 239 | } |
| 240 | 240 | public function getDetections() |
| 241 | 241 | { |
| 242 | - return $this->detections; |
|
| 242 | + return $this->detections; |
|
| 243 | 243 | } |
| 244 | 244 | } |
| 245 | 245 | |
@@ -254,27 +254,27 @@ discard block |
||
| 254 | 254 | |
| 255 | 255 | public function setConfidence($confidence) |
| 256 | 256 | { |
| 257 | - $this->confidence = $confidence; |
|
| 257 | + $this->confidence = $confidence; |
|
| 258 | 258 | } |
| 259 | 259 | public function getConfidence() |
| 260 | 260 | { |
| 261 | - return $this->confidence; |
|
| 261 | + return $this->confidence; |
|
| 262 | 262 | } |
| 263 | 263 | public function setIsReliable($isReliable) |
| 264 | 264 | { |
| 265 | - $this->isReliable = $isReliable; |
|
| 265 | + $this->isReliable = $isReliable; |
|
| 266 | 266 | } |
| 267 | 267 | public function getIsReliable() |
| 268 | 268 | { |
| 269 | - return $this->isReliable; |
|
| 269 | + return $this->isReliable; |
|
| 270 | 270 | } |
| 271 | 271 | public function setLanguage($language) |
| 272 | 272 | { |
| 273 | - $this->language = $language; |
|
| 273 | + $this->language = $language; |
|
| 274 | 274 | } |
| 275 | 275 | public function getLanguage() |
| 276 | 276 | { |
| 277 | - return $this->language; |
|
| 277 | + return $this->language; |
|
| 278 | 278 | } |
| 279 | 279 | } |
| 280 | 280 | |
@@ -289,11 +289,11 @@ discard block |
||
| 289 | 289 | |
| 290 | 290 | public function setLanguages($languages) |
| 291 | 291 | { |
| 292 | - $this->languages = $languages; |
|
| 292 | + $this->languages = $languages; |
|
| 293 | 293 | } |
| 294 | 294 | public function getLanguages() |
| 295 | 295 | { |
| 296 | - return $this->languages; |
|
| 296 | + return $this->languages; |
|
| 297 | 297 | } |
| 298 | 298 | } |
| 299 | 299 | |
@@ -307,19 +307,19 @@ discard block |
||
| 307 | 307 | |
| 308 | 308 | public function setLanguage($language) |
| 309 | 309 | { |
| 310 | - $this->language = $language; |
|
| 310 | + $this->language = $language; |
|
| 311 | 311 | } |
| 312 | 312 | public function getLanguage() |
| 313 | 313 | { |
| 314 | - return $this->language; |
|
| 314 | + return $this->language; |
|
| 315 | 315 | } |
| 316 | 316 | public function setName($name) |
| 317 | 317 | { |
| 318 | - $this->name = $name; |
|
| 318 | + $this->name = $name; |
|
| 319 | 319 | } |
| 320 | 320 | public function getName() |
| 321 | 321 | { |
| 322 | - return $this->name; |
|
| 322 | + return $this->name; |
|
| 323 | 323 | } |
| 324 | 324 | } |
| 325 | 325 | |
@@ -334,11 +334,11 @@ discard block |
||
| 334 | 334 | |
| 335 | 335 | public function setTranslations($translations) |
| 336 | 336 | { |
| 337 | - $this->translations = $translations; |
|
| 337 | + $this->translations = $translations; |
|
| 338 | 338 | } |
| 339 | 339 | public function getTranslations() |
| 340 | 340 | { |
| 341 | - return $this->translations; |
|
| 341 | + return $this->translations; |
|
| 342 | 342 | } |
| 343 | 343 | } |
| 344 | 344 | |
@@ -352,18 +352,18 @@ discard block |
||
| 352 | 352 | |
| 353 | 353 | public function setDetectedSourceLanguage($detectedSourceLanguage) |
| 354 | 354 | { |
| 355 | - $this->detectedSourceLanguage = $detectedSourceLanguage; |
|
| 355 | + $this->detectedSourceLanguage = $detectedSourceLanguage; |
|
| 356 | 356 | } |
| 357 | 357 | public function getDetectedSourceLanguage() |
| 358 | 358 | { |
| 359 | - return $this->detectedSourceLanguage; |
|
| 359 | + return $this->detectedSourceLanguage; |
|
| 360 | 360 | } |
| 361 | 361 | public function setTranslatedText($translatedText) |
| 362 | 362 | { |
| 363 | - $this->translatedText = $translatedText; |
|
| 363 | + $this->translatedText = $translatedText; |
|
| 364 | 364 | } |
| 365 | 365 | public function getTranslatedText() |
| 366 | 366 | { |
| 367 | - return $this->translatedText; |
|
| 367 | + return $this->translatedText; |
|
| 368 | 368 | } |
| 369 | 369 | } |