@@ -42,156 +42,156 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | public function __construct(Google_Client $client) |
| 44 | 44 | { |
| 45 | - parent::__construct($client); |
|
| 46 | - $this->rootUrl = 'https://www.googleapis.com/'; |
|
| 47 | - $this->servicePath = 'customsearch/'; |
|
| 48 | - $this->version = 'v1'; |
|
| 49 | - $this->serviceName = 'customsearch'; |
|
| 45 | + parent::__construct($client); |
|
| 46 | + $this->rootUrl = 'https://www.googleapis.com/'; |
|
| 47 | + $this->servicePath = 'customsearch/'; |
|
| 48 | + $this->version = 'v1'; |
|
| 49 | + $this->serviceName = 'customsearch'; |
|
| 50 | 50 | |
| 51 | - $this->cse = new Google_Service_Customsearch_Cse_Resource( |
|
| 52 | - $this, |
|
| 53 | - $this->serviceName, |
|
| 54 | - 'cse', |
|
| 55 | - array( |
|
| 56 | - 'methods' => array( |
|
| 57 | - 'list' => array( |
|
| 58 | - 'path' => 'v1', |
|
| 59 | - 'httpMethod' => 'GET', |
|
| 60 | - 'parameters' => array( |
|
| 61 | - 'q' => array( |
|
| 62 | - 'location' => 'query', |
|
| 63 | - 'type' => 'string', |
|
| 64 | - 'required' => true, |
|
| 65 | - ), |
|
| 66 | - 'sort' => array( |
|
| 67 | - 'location' => 'query', |
|
| 68 | - 'type' => 'string', |
|
| 69 | - ), |
|
| 70 | - 'orTerms' => array( |
|
| 71 | - 'location' => 'query', |
|
| 72 | - 'type' => 'string', |
|
| 73 | - ), |
|
| 74 | - 'highRange' => array( |
|
| 75 | - 'location' => 'query', |
|
| 76 | - 'type' => 'string', |
|
| 77 | - ), |
|
| 78 | - 'num' => array( |
|
| 79 | - 'location' => 'query', |
|
| 80 | - 'type' => 'integer', |
|
| 81 | - ), |
|
| 82 | - 'cr' => array( |
|
| 83 | - 'location' => 'query', |
|
| 84 | - 'type' => 'string', |
|
| 85 | - ), |
|
| 86 | - 'imgType' => array( |
|
| 87 | - 'location' => 'query', |
|
| 88 | - 'type' => 'string', |
|
| 89 | - ), |
|
| 90 | - 'gl' => array( |
|
| 91 | - 'location' => 'query', |
|
| 92 | - 'type' => 'string', |
|
| 93 | - ), |
|
| 94 | - 'relatedSite' => array( |
|
| 95 | - 'location' => 'query', |
|
| 96 | - 'type' => 'string', |
|
| 97 | - ), |
|
| 98 | - 'searchType' => array( |
|
| 99 | - 'location' => 'query', |
|
| 100 | - 'type' => 'string', |
|
| 101 | - ), |
|
| 102 | - 'fileType' => array( |
|
| 103 | - 'location' => 'query', |
|
| 104 | - 'type' => 'string', |
|
| 105 | - ), |
|
| 106 | - 'start' => array( |
|
| 107 | - 'location' => 'query', |
|
| 108 | - 'type' => 'integer', |
|
| 109 | - ), |
|
| 110 | - 'imgDominantColor' => array( |
|
| 111 | - 'location' => 'query', |
|
| 112 | - 'type' => 'string', |
|
| 113 | - ), |
|
| 114 | - 'lr' => array( |
|
| 115 | - 'location' => 'query', |
|
| 116 | - 'type' => 'string', |
|
| 117 | - ), |
|
| 118 | - 'siteSearch' => array( |
|
| 119 | - 'location' => 'query', |
|
| 120 | - 'type' => 'string', |
|
| 121 | - ), |
|
| 122 | - 'cref' => array( |
|
| 123 | - 'location' => 'query', |
|
| 124 | - 'type' => 'string', |
|
| 125 | - ), |
|
| 126 | - 'dateRestrict' => array( |
|
| 127 | - 'location' => 'query', |
|
| 128 | - 'type' => 'string', |
|
| 129 | - ), |
|
| 130 | - 'safe' => array( |
|
| 131 | - 'location' => 'query', |
|
| 132 | - 'type' => 'string', |
|
| 133 | - ), |
|
| 134 | - 'c2coff' => array( |
|
| 135 | - 'location' => 'query', |
|
| 136 | - 'type' => 'string', |
|
| 137 | - ), |
|
| 138 | - 'googlehost' => array( |
|
| 139 | - 'location' => 'query', |
|
| 140 | - 'type' => 'string', |
|
| 141 | - ), |
|
| 142 | - 'hq' => array( |
|
| 143 | - 'location' => 'query', |
|
| 144 | - 'type' => 'string', |
|
| 145 | - ), |
|
| 146 | - 'exactTerms' => array( |
|
| 147 | - 'location' => 'query', |
|
| 148 | - 'type' => 'string', |
|
| 149 | - ), |
|
| 150 | - 'hl' => array( |
|
| 151 | - 'location' => 'query', |
|
| 152 | - 'type' => 'string', |
|
| 153 | - ), |
|
| 154 | - 'lowRange' => array( |
|
| 155 | - 'location' => 'query', |
|
| 156 | - 'type' => 'string', |
|
| 157 | - ), |
|
| 158 | - 'imgSize' => array( |
|
| 159 | - 'location' => 'query', |
|
| 160 | - 'type' => 'string', |
|
| 161 | - ), |
|
| 162 | - 'imgColorType' => array( |
|
| 163 | - 'location' => 'query', |
|
| 164 | - 'type' => 'string', |
|
| 165 | - ), |
|
| 166 | - 'rights' => array( |
|
| 167 | - 'location' => 'query', |
|
| 168 | - 'type' => 'string', |
|
| 169 | - ), |
|
| 170 | - 'excludeTerms' => array( |
|
| 171 | - 'location' => 'query', |
|
| 172 | - 'type' => 'string', |
|
| 173 | - ), |
|
| 174 | - 'filter' => array( |
|
| 175 | - 'location' => 'query', |
|
| 176 | - 'type' => 'string', |
|
| 177 | - ), |
|
| 178 | - 'linkSite' => array( |
|
| 179 | - 'location' => 'query', |
|
| 180 | - 'type' => 'string', |
|
| 181 | - ), |
|
| 182 | - 'cx' => array( |
|
| 183 | - 'location' => 'query', |
|
| 184 | - 'type' => 'string', |
|
| 185 | - ), |
|
| 186 | - 'siteSearchFilter' => array( |
|
| 187 | - 'location' => 'query', |
|
| 188 | - 'type' => 'string', |
|
| 189 | - ), |
|
| 190 | - ), |
|
| 191 | - ), |
|
| 192 | - ) |
|
| 193 | - ) |
|
| 194 | - ); |
|
| 51 | + $this->cse = new Google_Service_Customsearch_Cse_Resource( |
|
| 52 | + $this, |
|
| 53 | + $this->serviceName, |
|
| 54 | + 'cse', |
|
| 55 | + array( |
|
| 56 | + 'methods' => array( |
|
| 57 | + 'list' => array( |
|
| 58 | + 'path' => 'v1', |
|
| 59 | + 'httpMethod' => 'GET', |
|
| 60 | + 'parameters' => array( |
|
| 61 | + 'q' => array( |
|
| 62 | + 'location' => 'query', |
|
| 63 | + 'type' => 'string', |
|
| 64 | + 'required' => true, |
|
| 65 | + ), |
|
| 66 | + 'sort' => array( |
|
| 67 | + 'location' => 'query', |
|
| 68 | + 'type' => 'string', |
|
| 69 | + ), |
|
| 70 | + 'orTerms' => array( |
|
| 71 | + 'location' => 'query', |
|
| 72 | + 'type' => 'string', |
|
| 73 | + ), |
|
| 74 | + 'highRange' => array( |
|
| 75 | + 'location' => 'query', |
|
| 76 | + 'type' => 'string', |
|
| 77 | + ), |
|
| 78 | + 'num' => array( |
|
| 79 | + 'location' => 'query', |
|
| 80 | + 'type' => 'integer', |
|
| 81 | + ), |
|
| 82 | + 'cr' => array( |
|
| 83 | + 'location' => 'query', |
|
| 84 | + 'type' => 'string', |
|
| 85 | + ), |
|
| 86 | + 'imgType' => array( |
|
| 87 | + 'location' => 'query', |
|
| 88 | + 'type' => 'string', |
|
| 89 | + ), |
|
| 90 | + 'gl' => array( |
|
| 91 | + 'location' => 'query', |
|
| 92 | + 'type' => 'string', |
|
| 93 | + ), |
|
| 94 | + 'relatedSite' => array( |
|
| 95 | + 'location' => 'query', |
|
| 96 | + 'type' => 'string', |
|
| 97 | + ), |
|
| 98 | + 'searchType' => array( |
|
| 99 | + 'location' => 'query', |
|
| 100 | + 'type' => 'string', |
|
| 101 | + ), |
|
| 102 | + 'fileType' => array( |
|
| 103 | + 'location' => 'query', |
|
| 104 | + 'type' => 'string', |
|
| 105 | + ), |
|
| 106 | + 'start' => array( |
|
| 107 | + 'location' => 'query', |
|
| 108 | + 'type' => 'integer', |
|
| 109 | + ), |
|
| 110 | + 'imgDominantColor' => array( |
|
| 111 | + 'location' => 'query', |
|
| 112 | + 'type' => 'string', |
|
| 113 | + ), |
|
| 114 | + 'lr' => array( |
|
| 115 | + 'location' => 'query', |
|
| 116 | + 'type' => 'string', |
|
| 117 | + ), |
|
| 118 | + 'siteSearch' => array( |
|
| 119 | + 'location' => 'query', |
|
| 120 | + 'type' => 'string', |
|
| 121 | + ), |
|
| 122 | + 'cref' => array( |
|
| 123 | + 'location' => 'query', |
|
| 124 | + 'type' => 'string', |
|
| 125 | + ), |
|
| 126 | + 'dateRestrict' => array( |
|
| 127 | + 'location' => 'query', |
|
| 128 | + 'type' => 'string', |
|
| 129 | + ), |
|
| 130 | + 'safe' => array( |
|
| 131 | + 'location' => 'query', |
|
| 132 | + 'type' => 'string', |
|
| 133 | + ), |
|
| 134 | + 'c2coff' => array( |
|
| 135 | + 'location' => 'query', |
|
| 136 | + 'type' => 'string', |
|
| 137 | + ), |
|
| 138 | + 'googlehost' => array( |
|
| 139 | + 'location' => 'query', |
|
| 140 | + 'type' => 'string', |
|
| 141 | + ), |
|
| 142 | + 'hq' => array( |
|
| 143 | + 'location' => 'query', |
|
| 144 | + 'type' => 'string', |
|
| 145 | + ), |
|
| 146 | + 'exactTerms' => array( |
|
| 147 | + 'location' => 'query', |
|
| 148 | + 'type' => 'string', |
|
| 149 | + ), |
|
| 150 | + 'hl' => array( |
|
| 151 | + 'location' => 'query', |
|
| 152 | + 'type' => 'string', |
|
| 153 | + ), |
|
| 154 | + 'lowRange' => array( |
|
| 155 | + 'location' => 'query', |
|
| 156 | + 'type' => 'string', |
|
| 157 | + ), |
|
| 158 | + 'imgSize' => array( |
|
| 159 | + 'location' => 'query', |
|
| 160 | + 'type' => 'string', |
|
| 161 | + ), |
|
| 162 | + 'imgColorType' => array( |
|
| 163 | + 'location' => 'query', |
|
| 164 | + 'type' => 'string', |
|
| 165 | + ), |
|
| 166 | + 'rights' => array( |
|
| 167 | + 'location' => 'query', |
|
| 168 | + 'type' => 'string', |
|
| 169 | + ), |
|
| 170 | + 'excludeTerms' => array( |
|
| 171 | + 'location' => 'query', |
|
| 172 | + 'type' => 'string', |
|
| 173 | + ), |
|
| 174 | + 'filter' => array( |
|
| 175 | + 'location' => 'query', |
|
| 176 | + 'type' => 'string', |
|
| 177 | + ), |
|
| 178 | + 'linkSite' => array( |
|
| 179 | + 'location' => 'query', |
|
| 180 | + 'type' => 'string', |
|
| 181 | + ), |
|
| 182 | + 'cx' => array( |
|
| 183 | + 'location' => 'query', |
|
| 184 | + 'type' => 'string', |
|
| 185 | + ), |
|
| 186 | + 'siteSearchFilter' => array( |
|
| 187 | + 'location' => 'query', |
|
| 188 | + 'type' => 'string', |
|
| 189 | + ), |
|
| 190 | + ), |
|
| 191 | + ), |
|
| 192 | + ) |
|
| 193 | + ) |
|
| 194 | + ); |
|
| 195 | 195 | } |
| 196 | 196 | } |
| 197 | 197 | |
@@ -269,9 +269,9 @@ discard block |
||
| 269 | 269 | */ |
| 270 | 270 | public function listCse($q, $optParams = array()) |
| 271 | 271 | { |
| 272 | - $params = array('q' => $q); |
|
| 273 | - $params = array_merge($params, $optParams); |
|
| 274 | - return $this->call('list', array($params), "Google_Service_Customsearch_Search"); |
|
| 272 | + $params = array('q' => $q); |
|
| 273 | + $params = array_merge($params, $optParams); |
|
| 274 | + return $this->call('list', array($params), "Google_Service_Customsearch_Search"); |
|
| 275 | 275 | } |
| 276 | 276 | } |
| 277 | 277 | |
@@ -290,26 +290,26 @@ discard block |
||
| 290 | 290 | |
| 291 | 291 | public function setFacets($facets) |
| 292 | 292 | { |
| 293 | - $this->facets = $facets; |
|
| 293 | + $this->facets = $facets; |
|
| 294 | 294 | } |
| 295 | 295 | public function getFacets() |
| 296 | 296 | { |
| 297 | - return $this->facets; |
|
| 297 | + return $this->facets; |
|
| 298 | 298 | } |
| 299 | 299 | public function setTitle($title) |
| 300 | 300 | { |
| 301 | - $this->title = $title; |
|
| 301 | + $this->title = $title; |
|
| 302 | 302 | } |
| 303 | 303 | public function getTitle() |
| 304 | 304 | { |
| 305 | - return $this->title; |
|
| 305 | + return $this->title; |
|
| 306 | 306 | } |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | class Google_Service_Customsearch_ContextFacets extends Google_Model |
| 310 | 310 | { |
| 311 | 311 | protected $internal_gapi_mappings = array( |
| 312 | - "labelWithOp" => "label_with_op", |
|
| 312 | + "labelWithOp" => "label_with_op", |
|
| 313 | 313 | ); |
| 314 | 314 | public $anchor; |
| 315 | 315 | public $label; |
@@ -318,27 +318,27 @@ discard block |
||
| 318 | 318 | |
| 319 | 319 | public function setAnchor($anchor) |
| 320 | 320 | { |
| 321 | - $this->anchor = $anchor; |
|
| 321 | + $this->anchor = $anchor; |
|
| 322 | 322 | } |
| 323 | 323 | public function getAnchor() |
| 324 | 324 | { |
| 325 | - return $this->anchor; |
|
| 325 | + return $this->anchor; |
|
| 326 | 326 | } |
| 327 | 327 | public function setLabel($label) |
| 328 | 328 | { |
| 329 | - $this->label = $label; |
|
| 329 | + $this->label = $label; |
|
| 330 | 330 | } |
| 331 | 331 | public function getLabel() |
| 332 | 332 | { |
| 333 | - return $this->label; |
|
| 333 | + return $this->label; |
|
| 334 | 334 | } |
| 335 | 335 | public function setLabelWithOp($labelWithOp) |
| 336 | 336 | { |
| 337 | - $this->labelWithOp = $labelWithOp; |
|
| 337 | + $this->labelWithOp = $labelWithOp; |
|
| 338 | 338 | } |
| 339 | 339 | public function getLabelWithOp() |
| 340 | 340 | { |
| 341 | - return $this->labelWithOp; |
|
| 341 | + return $this->labelWithOp; |
|
| 342 | 342 | } |
| 343 | 343 | } |
| 344 | 344 | |
@@ -359,51 +359,51 @@ discard block |
||
| 359 | 359 | |
| 360 | 360 | public function setBodyLines($bodyLines) |
| 361 | 361 | { |
| 362 | - $this->bodyLines = $bodyLines; |
|
| 362 | + $this->bodyLines = $bodyLines; |
|
| 363 | 363 | } |
| 364 | 364 | public function getBodyLines() |
| 365 | 365 | { |
| 366 | - return $this->bodyLines; |
|
| 366 | + return $this->bodyLines; |
|
| 367 | 367 | } |
| 368 | 368 | public function setDisplayLink($displayLink) |
| 369 | 369 | { |
| 370 | - $this->displayLink = $displayLink; |
|
| 370 | + $this->displayLink = $displayLink; |
|
| 371 | 371 | } |
| 372 | 372 | public function getDisplayLink() |
| 373 | 373 | { |
| 374 | - return $this->displayLink; |
|
| 374 | + return $this->displayLink; |
|
| 375 | 375 | } |
| 376 | 376 | public function setHtmlTitle($htmlTitle) |
| 377 | 377 | { |
| 378 | - $this->htmlTitle = $htmlTitle; |
|
| 378 | + $this->htmlTitle = $htmlTitle; |
|
| 379 | 379 | } |
| 380 | 380 | public function getHtmlTitle() |
| 381 | 381 | { |
| 382 | - return $this->htmlTitle; |
|
| 382 | + return $this->htmlTitle; |
|
| 383 | 383 | } |
| 384 | 384 | public function setImage(Google_Service_Customsearch_PromotionImage $image) |
| 385 | 385 | { |
| 386 | - $this->image = $image; |
|
| 386 | + $this->image = $image; |
|
| 387 | 387 | } |
| 388 | 388 | public function getImage() |
| 389 | 389 | { |
| 390 | - return $this->image; |
|
| 390 | + return $this->image; |
|
| 391 | 391 | } |
| 392 | 392 | public function setLink($link) |
| 393 | 393 | { |
| 394 | - $this->link = $link; |
|
| 394 | + $this->link = $link; |
|
| 395 | 395 | } |
| 396 | 396 | public function getLink() |
| 397 | 397 | { |
| 398 | - return $this->link; |
|
| 398 | + return $this->link; |
|
| 399 | 399 | } |
| 400 | 400 | public function setTitle($title) |
| 401 | 401 | { |
| 402 | - $this->title = $title; |
|
| 402 | + $this->title = $title; |
|
| 403 | 403 | } |
| 404 | 404 | public function getTitle() |
| 405 | 405 | { |
| 406 | - return $this->title; |
|
| 406 | + return $this->title; |
|
| 407 | 407 | } |
| 408 | 408 | } |
| 409 | 409 | |
@@ -419,35 +419,35 @@ discard block |
||
| 419 | 419 | |
| 420 | 420 | public function setHtmlTitle($htmlTitle) |
| 421 | 421 | { |
| 422 | - $this->htmlTitle = $htmlTitle; |
|
| 422 | + $this->htmlTitle = $htmlTitle; |
|
| 423 | 423 | } |
| 424 | 424 | public function getHtmlTitle() |
| 425 | 425 | { |
| 426 | - return $this->htmlTitle; |
|
| 426 | + return $this->htmlTitle; |
|
| 427 | 427 | } |
| 428 | 428 | public function setLink($link) |
| 429 | 429 | { |
| 430 | - $this->link = $link; |
|
| 430 | + $this->link = $link; |
|
| 431 | 431 | } |
| 432 | 432 | public function getLink() |
| 433 | 433 | { |
| 434 | - return $this->link; |
|
| 434 | + return $this->link; |
|
| 435 | 435 | } |
| 436 | 436 | public function setTitle($title) |
| 437 | 437 | { |
| 438 | - $this->title = $title; |
|
| 438 | + $this->title = $title; |
|
| 439 | 439 | } |
| 440 | 440 | public function getTitle() |
| 441 | 441 | { |
| 442 | - return $this->title; |
|
| 442 | + return $this->title; |
|
| 443 | 443 | } |
| 444 | 444 | public function setUrl($url) |
| 445 | 445 | { |
| 446 | - $this->url = $url; |
|
| 446 | + $this->url = $url; |
|
| 447 | 447 | } |
| 448 | 448 | public function getUrl() |
| 449 | 449 | { |
| 450 | - return $this->url; |
|
| 450 | + return $this->url; |
|
| 451 | 451 | } |
| 452 | 452 | } |
| 453 | 453 | |
@@ -462,27 +462,27 @@ discard block |
||
| 462 | 462 | |
| 463 | 463 | public function setHeight($height) |
| 464 | 464 | { |
| 465 | - $this->height = $height; |
|
| 465 | + $this->height = $height; |
|
| 466 | 466 | } |
| 467 | 467 | public function getHeight() |
| 468 | 468 | { |
| 469 | - return $this->height; |
|
| 469 | + return $this->height; |
|
| 470 | 470 | } |
| 471 | 471 | public function setSource($source) |
| 472 | 472 | { |
| 473 | - $this->source = $source; |
|
| 473 | + $this->source = $source; |
|
| 474 | 474 | } |
| 475 | 475 | public function getSource() |
| 476 | 476 | { |
| 477 | - return $this->source; |
|
| 477 | + return $this->source; |
|
| 478 | 478 | } |
| 479 | 479 | public function setWidth($width) |
| 480 | 480 | { |
| 481 | - $this->width = $width; |
|
| 481 | + $this->width = $width; |
|
| 482 | 482 | } |
| 483 | 483 | public function getWidth() |
| 484 | 484 | { |
| 485 | - return $this->width; |
|
| 485 | + return $this->width; |
|
| 486 | 486 | } |
| 487 | 487 | } |
| 488 | 488 | |
@@ -531,299 +531,299 @@ discard block |
||
| 531 | 531 | |
| 532 | 532 | public function setCount($count) |
| 533 | 533 | { |
| 534 | - $this->count = $count; |
|
| 534 | + $this->count = $count; |
|
| 535 | 535 | } |
| 536 | 536 | public function getCount() |
| 537 | 537 | { |
| 538 | - return $this->count; |
|
| 538 | + return $this->count; |
|
| 539 | 539 | } |
| 540 | 540 | public function setCr($cr) |
| 541 | 541 | { |
| 542 | - $this->cr = $cr; |
|
| 542 | + $this->cr = $cr; |
|
| 543 | 543 | } |
| 544 | 544 | public function getCr() |
| 545 | 545 | { |
| 546 | - return $this->cr; |
|
| 546 | + return $this->cr; |
|
| 547 | 547 | } |
| 548 | 548 | public function setCref($cref) |
| 549 | 549 | { |
| 550 | - $this->cref = $cref; |
|
| 550 | + $this->cref = $cref; |
|
| 551 | 551 | } |
| 552 | 552 | public function getCref() |
| 553 | 553 | { |
| 554 | - return $this->cref; |
|
| 554 | + return $this->cref; |
|
| 555 | 555 | } |
| 556 | 556 | public function setCx($cx) |
| 557 | 557 | { |
| 558 | - $this->cx = $cx; |
|
| 558 | + $this->cx = $cx; |
|
| 559 | 559 | } |
| 560 | 560 | public function getCx() |
| 561 | 561 | { |
| 562 | - return $this->cx; |
|
| 562 | + return $this->cx; |
|
| 563 | 563 | } |
| 564 | 564 | public function setDateRestrict($dateRestrict) |
| 565 | 565 | { |
| 566 | - $this->dateRestrict = $dateRestrict; |
|
| 566 | + $this->dateRestrict = $dateRestrict; |
|
| 567 | 567 | } |
| 568 | 568 | public function getDateRestrict() |
| 569 | 569 | { |
| 570 | - return $this->dateRestrict; |
|
| 570 | + return $this->dateRestrict; |
|
| 571 | 571 | } |
| 572 | 572 | public function setDisableCnTwTranslation($disableCnTwTranslation) |
| 573 | 573 | { |
| 574 | - $this->disableCnTwTranslation = $disableCnTwTranslation; |
|
| 574 | + $this->disableCnTwTranslation = $disableCnTwTranslation; |
|
| 575 | 575 | } |
| 576 | 576 | public function getDisableCnTwTranslation() |
| 577 | 577 | { |
| 578 | - return $this->disableCnTwTranslation; |
|
| 578 | + return $this->disableCnTwTranslation; |
|
| 579 | 579 | } |
| 580 | 580 | public function setExactTerms($exactTerms) |
| 581 | 581 | { |
| 582 | - $this->exactTerms = $exactTerms; |
|
| 582 | + $this->exactTerms = $exactTerms; |
|
| 583 | 583 | } |
| 584 | 584 | public function getExactTerms() |
| 585 | 585 | { |
| 586 | - return $this->exactTerms; |
|
| 586 | + return $this->exactTerms; |
|
| 587 | 587 | } |
| 588 | 588 | public function setExcludeTerms($excludeTerms) |
| 589 | 589 | { |
| 590 | - $this->excludeTerms = $excludeTerms; |
|
| 590 | + $this->excludeTerms = $excludeTerms; |
|
| 591 | 591 | } |
| 592 | 592 | public function getExcludeTerms() |
| 593 | 593 | { |
| 594 | - return $this->excludeTerms; |
|
| 594 | + return $this->excludeTerms; |
|
| 595 | 595 | } |
| 596 | 596 | public function setFileType($fileType) |
| 597 | 597 | { |
| 598 | - $this->fileType = $fileType; |
|
| 598 | + $this->fileType = $fileType; |
|
| 599 | 599 | } |
| 600 | 600 | public function getFileType() |
| 601 | 601 | { |
| 602 | - return $this->fileType; |
|
| 602 | + return $this->fileType; |
|
| 603 | 603 | } |
| 604 | 604 | public function setFilter($filter) |
| 605 | 605 | { |
| 606 | - $this->filter = $filter; |
|
| 606 | + $this->filter = $filter; |
|
| 607 | 607 | } |
| 608 | 608 | public function getFilter() |
| 609 | 609 | { |
| 610 | - return $this->filter; |
|
| 610 | + return $this->filter; |
|
| 611 | 611 | } |
| 612 | 612 | public function setGl($gl) |
| 613 | 613 | { |
| 614 | - $this->gl = $gl; |
|
| 614 | + $this->gl = $gl; |
|
| 615 | 615 | } |
| 616 | 616 | public function getGl() |
| 617 | 617 | { |
| 618 | - return $this->gl; |
|
| 618 | + return $this->gl; |
|
| 619 | 619 | } |
| 620 | 620 | public function setGoogleHost($googleHost) |
| 621 | 621 | { |
| 622 | - $this->googleHost = $googleHost; |
|
| 622 | + $this->googleHost = $googleHost; |
|
| 623 | 623 | } |
| 624 | 624 | public function getGoogleHost() |
| 625 | 625 | { |
| 626 | - return $this->googleHost; |
|
| 626 | + return $this->googleHost; |
|
| 627 | 627 | } |
| 628 | 628 | public function setHighRange($highRange) |
| 629 | 629 | { |
| 630 | - $this->highRange = $highRange; |
|
| 630 | + $this->highRange = $highRange; |
|
| 631 | 631 | } |
| 632 | 632 | public function getHighRange() |
| 633 | 633 | { |
| 634 | - return $this->highRange; |
|
| 634 | + return $this->highRange; |
|
| 635 | 635 | } |
| 636 | 636 | public function setHl($hl) |
| 637 | 637 | { |
| 638 | - $this->hl = $hl; |
|
| 638 | + $this->hl = $hl; |
|
| 639 | 639 | } |
| 640 | 640 | public function getHl() |
| 641 | 641 | { |
| 642 | - return $this->hl; |
|
| 642 | + return $this->hl; |
|
| 643 | 643 | } |
| 644 | 644 | public function setHq($hq) |
| 645 | 645 | { |
| 646 | - $this->hq = $hq; |
|
| 646 | + $this->hq = $hq; |
|
| 647 | 647 | } |
| 648 | 648 | public function getHq() |
| 649 | 649 | { |
| 650 | - return $this->hq; |
|
| 650 | + return $this->hq; |
|
| 651 | 651 | } |
| 652 | 652 | public function setImgColorType($imgColorType) |
| 653 | 653 | { |
| 654 | - $this->imgColorType = $imgColorType; |
|
| 654 | + $this->imgColorType = $imgColorType; |
|
| 655 | 655 | } |
| 656 | 656 | public function getImgColorType() |
| 657 | 657 | { |
| 658 | - return $this->imgColorType; |
|
| 658 | + return $this->imgColorType; |
|
| 659 | 659 | } |
| 660 | 660 | public function setImgDominantColor($imgDominantColor) |
| 661 | 661 | { |
| 662 | - $this->imgDominantColor = $imgDominantColor; |
|
| 662 | + $this->imgDominantColor = $imgDominantColor; |
|
| 663 | 663 | } |
| 664 | 664 | public function getImgDominantColor() |
| 665 | 665 | { |
| 666 | - return $this->imgDominantColor; |
|
| 666 | + return $this->imgDominantColor; |
|
| 667 | 667 | } |
| 668 | 668 | public function setImgSize($imgSize) |
| 669 | 669 | { |
| 670 | - $this->imgSize = $imgSize; |
|
| 670 | + $this->imgSize = $imgSize; |
|
| 671 | 671 | } |
| 672 | 672 | public function getImgSize() |
| 673 | 673 | { |
| 674 | - return $this->imgSize; |
|
| 674 | + return $this->imgSize; |
|
| 675 | 675 | } |
| 676 | 676 | public function setImgType($imgType) |
| 677 | 677 | { |
| 678 | - $this->imgType = $imgType; |
|
| 678 | + $this->imgType = $imgType; |
|
| 679 | 679 | } |
| 680 | 680 | public function getImgType() |
| 681 | 681 | { |
| 682 | - return $this->imgType; |
|
| 682 | + return $this->imgType; |
|
| 683 | 683 | } |
| 684 | 684 | public function setInputEncoding($inputEncoding) |
| 685 | 685 | { |
| 686 | - $this->inputEncoding = $inputEncoding; |
|
| 686 | + $this->inputEncoding = $inputEncoding; |
|
| 687 | 687 | } |
| 688 | 688 | public function getInputEncoding() |
| 689 | 689 | { |
| 690 | - return $this->inputEncoding; |
|
| 690 | + return $this->inputEncoding; |
|
| 691 | 691 | } |
| 692 | 692 | public function setLanguage($language) |
| 693 | 693 | { |
| 694 | - $this->language = $language; |
|
| 694 | + $this->language = $language; |
|
| 695 | 695 | } |
| 696 | 696 | public function getLanguage() |
| 697 | 697 | { |
| 698 | - return $this->language; |
|
| 698 | + return $this->language; |
|
| 699 | 699 | } |
| 700 | 700 | public function setLinkSite($linkSite) |
| 701 | 701 | { |
| 702 | - $this->linkSite = $linkSite; |
|
| 702 | + $this->linkSite = $linkSite; |
|
| 703 | 703 | } |
| 704 | 704 | public function getLinkSite() |
| 705 | 705 | { |
| 706 | - return $this->linkSite; |
|
| 706 | + return $this->linkSite; |
|
| 707 | 707 | } |
| 708 | 708 | public function setLowRange($lowRange) |
| 709 | 709 | { |
| 710 | - $this->lowRange = $lowRange; |
|
| 710 | + $this->lowRange = $lowRange; |
|
| 711 | 711 | } |
| 712 | 712 | public function getLowRange() |
| 713 | 713 | { |
| 714 | - return $this->lowRange; |
|
| 714 | + return $this->lowRange; |
|
| 715 | 715 | } |
| 716 | 716 | public function setOrTerms($orTerms) |
| 717 | 717 | { |
| 718 | - $this->orTerms = $orTerms; |
|
| 718 | + $this->orTerms = $orTerms; |
|
| 719 | 719 | } |
| 720 | 720 | public function getOrTerms() |
| 721 | 721 | { |
| 722 | - return $this->orTerms; |
|
| 722 | + return $this->orTerms; |
|
| 723 | 723 | } |
| 724 | 724 | public function setOutputEncoding($outputEncoding) |
| 725 | 725 | { |
| 726 | - $this->outputEncoding = $outputEncoding; |
|
| 726 | + $this->outputEncoding = $outputEncoding; |
|
| 727 | 727 | } |
| 728 | 728 | public function getOutputEncoding() |
| 729 | 729 | { |
| 730 | - return $this->outputEncoding; |
|
| 730 | + return $this->outputEncoding; |
|
| 731 | 731 | } |
| 732 | 732 | public function setRelatedSite($relatedSite) |
| 733 | 733 | { |
| 734 | - $this->relatedSite = $relatedSite; |
|
| 734 | + $this->relatedSite = $relatedSite; |
|
| 735 | 735 | } |
| 736 | 736 | public function getRelatedSite() |
| 737 | 737 | { |
| 738 | - return $this->relatedSite; |
|
| 738 | + return $this->relatedSite; |
|
| 739 | 739 | } |
| 740 | 740 | public function setRights($rights) |
| 741 | 741 | { |
| 742 | - $this->rights = $rights; |
|
| 742 | + $this->rights = $rights; |
|
| 743 | 743 | } |
| 744 | 744 | public function getRights() |
| 745 | 745 | { |
| 746 | - return $this->rights; |
|
| 746 | + return $this->rights; |
|
| 747 | 747 | } |
| 748 | 748 | public function setSafe($safe) |
| 749 | 749 | { |
| 750 | - $this->safe = $safe; |
|
| 750 | + $this->safe = $safe; |
|
| 751 | 751 | } |
| 752 | 752 | public function getSafe() |
| 753 | 753 | { |
| 754 | - return $this->safe; |
|
| 754 | + return $this->safe; |
|
| 755 | 755 | } |
| 756 | 756 | public function setSearchTerms($searchTerms) |
| 757 | 757 | { |
| 758 | - $this->searchTerms = $searchTerms; |
|
| 758 | + $this->searchTerms = $searchTerms; |
|
| 759 | 759 | } |
| 760 | 760 | public function getSearchTerms() |
| 761 | 761 | { |
| 762 | - return $this->searchTerms; |
|
| 762 | + return $this->searchTerms; |
|
| 763 | 763 | } |
| 764 | 764 | public function setSearchType($searchType) |
| 765 | 765 | { |
| 766 | - $this->searchType = $searchType; |
|
| 766 | + $this->searchType = $searchType; |
|
| 767 | 767 | } |
| 768 | 768 | public function getSearchType() |
| 769 | 769 | { |
| 770 | - return $this->searchType; |
|
| 770 | + return $this->searchType; |
|
| 771 | 771 | } |
| 772 | 772 | public function setSiteSearch($siteSearch) |
| 773 | 773 | { |
| 774 | - $this->siteSearch = $siteSearch; |
|
| 774 | + $this->siteSearch = $siteSearch; |
|
| 775 | 775 | } |
| 776 | 776 | public function getSiteSearch() |
| 777 | 777 | { |
| 778 | - return $this->siteSearch; |
|
| 778 | + return $this->siteSearch; |
|
| 779 | 779 | } |
| 780 | 780 | public function setSiteSearchFilter($siteSearchFilter) |
| 781 | 781 | { |
| 782 | - $this->siteSearchFilter = $siteSearchFilter; |
|
| 782 | + $this->siteSearchFilter = $siteSearchFilter; |
|
| 783 | 783 | } |
| 784 | 784 | public function getSiteSearchFilter() |
| 785 | 785 | { |
| 786 | - return $this->siteSearchFilter; |
|
| 786 | + return $this->siteSearchFilter; |
|
| 787 | 787 | } |
| 788 | 788 | public function setSort($sort) |
| 789 | 789 | { |
| 790 | - $this->sort = $sort; |
|
| 790 | + $this->sort = $sort; |
|
| 791 | 791 | } |
| 792 | 792 | public function getSort() |
| 793 | 793 | { |
| 794 | - return $this->sort; |
|
| 794 | + return $this->sort; |
|
| 795 | 795 | } |
| 796 | 796 | public function setStartIndex($startIndex) |
| 797 | 797 | { |
| 798 | - $this->startIndex = $startIndex; |
|
| 798 | + $this->startIndex = $startIndex; |
|
| 799 | 799 | } |
| 800 | 800 | public function getStartIndex() |
| 801 | 801 | { |
| 802 | - return $this->startIndex; |
|
| 802 | + return $this->startIndex; |
|
| 803 | 803 | } |
| 804 | 804 | public function setStartPage($startPage) |
| 805 | 805 | { |
| 806 | - $this->startPage = $startPage; |
|
| 806 | + $this->startPage = $startPage; |
|
| 807 | 807 | } |
| 808 | 808 | public function getStartPage() |
| 809 | 809 | { |
| 810 | - return $this->startPage; |
|
| 810 | + return $this->startPage; |
|
| 811 | 811 | } |
| 812 | 812 | public function setTitle($title) |
| 813 | 813 | { |
| 814 | - $this->title = $title; |
|
| 814 | + $this->title = $title; |
|
| 815 | 815 | } |
| 816 | 816 | public function getTitle() |
| 817 | 817 | { |
| 818 | - return $this->title; |
|
| 818 | + return $this->title; |
|
| 819 | 819 | } |
| 820 | 820 | public function setTotalResults($totalResults) |
| 821 | 821 | { |
| 822 | - $this->totalResults = $totalResults; |
|
| 822 | + $this->totalResults = $totalResults; |
|
| 823 | 823 | } |
| 824 | 824 | public function getTotalResults() |
| 825 | 825 | { |
| 826 | - return $this->totalResults; |
|
| 826 | + return $this->totalResults; |
|
| 827 | 827 | } |
| 828 | 828 | } |
| 829 | 829 | |
@@ -853,123 +853,123 @@ discard block |
||
| 853 | 853 | |
| 854 | 854 | public function setCacheId($cacheId) |
| 855 | 855 | { |
| 856 | - $this->cacheId = $cacheId; |
|
| 856 | + $this->cacheId = $cacheId; |
|
| 857 | 857 | } |
| 858 | 858 | public function getCacheId() |
| 859 | 859 | { |
| 860 | - return $this->cacheId; |
|
| 860 | + return $this->cacheId; |
|
| 861 | 861 | } |
| 862 | 862 | public function setDisplayLink($displayLink) |
| 863 | 863 | { |
| 864 | - $this->displayLink = $displayLink; |
|
| 864 | + $this->displayLink = $displayLink; |
|
| 865 | 865 | } |
| 866 | 866 | public function getDisplayLink() |
| 867 | 867 | { |
| 868 | - return $this->displayLink; |
|
| 868 | + return $this->displayLink; |
|
| 869 | 869 | } |
| 870 | 870 | public function setFileFormat($fileFormat) |
| 871 | 871 | { |
| 872 | - $this->fileFormat = $fileFormat; |
|
| 872 | + $this->fileFormat = $fileFormat; |
|
| 873 | 873 | } |
| 874 | 874 | public function getFileFormat() |
| 875 | 875 | { |
| 876 | - return $this->fileFormat; |
|
| 876 | + return $this->fileFormat; |
|
| 877 | 877 | } |
| 878 | 878 | public function setFormattedUrl($formattedUrl) |
| 879 | 879 | { |
| 880 | - $this->formattedUrl = $formattedUrl; |
|
| 880 | + $this->formattedUrl = $formattedUrl; |
|
| 881 | 881 | } |
| 882 | 882 | public function getFormattedUrl() |
| 883 | 883 | { |
| 884 | - return $this->formattedUrl; |
|
| 884 | + return $this->formattedUrl; |
|
| 885 | 885 | } |
| 886 | 886 | public function setHtmlFormattedUrl($htmlFormattedUrl) |
| 887 | 887 | { |
| 888 | - $this->htmlFormattedUrl = $htmlFormattedUrl; |
|
| 888 | + $this->htmlFormattedUrl = $htmlFormattedUrl; |
|
| 889 | 889 | } |
| 890 | 890 | public function getHtmlFormattedUrl() |
| 891 | 891 | { |
| 892 | - return $this->htmlFormattedUrl; |
|
| 892 | + return $this->htmlFormattedUrl; |
|
| 893 | 893 | } |
| 894 | 894 | public function setHtmlSnippet($htmlSnippet) |
| 895 | 895 | { |
| 896 | - $this->htmlSnippet = $htmlSnippet; |
|
| 896 | + $this->htmlSnippet = $htmlSnippet; |
|
| 897 | 897 | } |
| 898 | 898 | public function getHtmlSnippet() |
| 899 | 899 | { |
| 900 | - return $this->htmlSnippet; |
|
| 900 | + return $this->htmlSnippet; |
|
| 901 | 901 | } |
| 902 | 902 | public function setHtmlTitle($htmlTitle) |
| 903 | 903 | { |
| 904 | - $this->htmlTitle = $htmlTitle; |
|
| 904 | + $this->htmlTitle = $htmlTitle; |
|
| 905 | 905 | } |
| 906 | 906 | public function getHtmlTitle() |
| 907 | 907 | { |
| 908 | - return $this->htmlTitle; |
|
| 908 | + return $this->htmlTitle; |
|
| 909 | 909 | } |
| 910 | 910 | public function setImage(Google_Service_Customsearch_ResultImage $image) |
| 911 | 911 | { |
| 912 | - $this->image = $image; |
|
| 912 | + $this->image = $image; |
|
| 913 | 913 | } |
| 914 | 914 | public function getImage() |
| 915 | 915 | { |
| 916 | - return $this->image; |
|
| 916 | + return $this->image; |
|
| 917 | 917 | } |
| 918 | 918 | public function setKind($kind) |
| 919 | 919 | { |
| 920 | - $this->kind = $kind; |
|
| 920 | + $this->kind = $kind; |
|
| 921 | 921 | } |
| 922 | 922 | public function getKind() |
| 923 | 923 | { |
| 924 | - return $this->kind; |
|
| 924 | + return $this->kind; |
|
| 925 | 925 | } |
| 926 | 926 | public function setLabels($labels) |
| 927 | 927 | { |
| 928 | - $this->labels = $labels; |
|
| 928 | + $this->labels = $labels; |
|
| 929 | 929 | } |
| 930 | 930 | public function getLabels() |
| 931 | 931 | { |
| 932 | - return $this->labels; |
|
| 932 | + return $this->labels; |
|
| 933 | 933 | } |
| 934 | 934 | public function setLink($link) |
| 935 | 935 | { |
| 936 | - $this->link = $link; |
|
| 936 | + $this->link = $link; |
|
| 937 | 937 | } |
| 938 | 938 | public function getLink() |
| 939 | 939 | { |
| 940 | - return $this->link; |
|
| 940 | + return $this->link; |
|
| 941 | 941 | } |
| 942 | 942 | public function setMime($mime) |
| 943 | 943 | { |
| 944 | - $this->mime = $mime; |
|
| 944 | + $this->mime = $mime; |
|
| 945 | 945 | } |
| 946 | 946 | public function getMime() |
| 947 | 947 | { |
| 948 | - return $this->mime; |
|
| 948 | + return $this->mime; |
|
| 949 | 949 | } |
| 950 | 950 | public function setPagemap($pagemap) |
| 951 | 951 | { |
| 952 | - $this->pagemap = $pagemap; |
|
| 952 | + $this->pagemap = $pagemap; |
|
| 953 | 953 | } |
| 954 | 954 | public function getPagemap() |
| 955 | 955 | { |
| 956 | - return $this->pagemap; |
|
| 956 | + return $this->pagemap; |
|
| 957 | 957 | } |
| 958 | 958 | public function setSnippet($snippet) |
| 959 | 959 | { |
| 960 | - $this->snippet = $snippet; |
|
| 960 | + $this->snippet = $snippet; |
|
| 961 | 961 | } |
| 962 | 962 | public function getSnippet() |
| 963 | 963 | { |
| 964 | - return $this->snippet; |
|
| 964 | + return $this->snippet; |
|
| 965 | 965 | } |
| 966 | 966 | public function setTitle($title) |
| 967 | 967 | { |
| 968 | - $this->title = $title; |
|
| 968 | + $this->title = $title; |
|
| 969 | 969 | } |
| 970 | 970 | public function getTitle() |
| 971 | 971 | { |
| 972 | - return $this->title; |
|
| 972 | + return $this->title; |
|
| 973 | 973 | } |
| 974 | 974 | } |
| 975 | 975 | |
@@ -988,66 +988,66 @@ discard block |
||
| 988 | 988 | |
| 989 | 989 | public function setByteSize($byteSize) |
| 990 | 990 | { |
| 991 | - $this->byteSize = $byteSize; |
|
| 991 | + $this->byteSize = $byteSize; |
|
| 992 | 992 | } |
| 993 | 993 | public function getByteSize() |
| 994 | 994 | { |
| 995 | - return $this->byteSize; |
|
| 995 | + return $this->byteSize; |
|
| 996 | 996 | } |
| 997 | 997 | public function setContextLink($contextLink) |
| 998 | 998 | { |
| 999 | - $this->contextLink = $contextLink; |
|
| 999 | + $this->contextLink = $contextLink; |
|
| 1000 | 1000 | } |
| 1001 | 1001 | public function getContextLink() |
| 1002 | 1002 | { |
| 1003 | - return $this->contextLink; |
|
| 1003 | + return $this->contextLink; |
|
| 1004 | 1004 | } |
| 1005 | 1005 | public function setHeight($height) |
| 1006 | 1006 | { |
| 1007 | - $this->height = $height; |
|
| 1007 | + $this->height = $height; |
|
| 1008 | 1008 | } |
| 1009 | 1009 | public function getHeight() |
| 1010 | 1010 | { |
| 1011 | - return $this->height; |
|
| 1011 | + return $this->height; |
|
| 1012 | 1012 | } |
| 1013 | 1013 | public function setThumbnailHeight($thumbnailHeight) |
| 1014 | 1014 | { |
| 1015 | - $this->thumbnailHeight = $thumbnailHeight; |
|
| 1015 | + $this->thumbnailHeight = $thumbnailHeight; |
|
| 1016 | 1016 | } |
| 1017 | 1017 | public function getThumbnailHeight() |
| 1018 | 1018 | { |
| 1019 | - return $this->thumbnailHeight; |
|
| 1019 | + return $this->thumbnailHeight; |
|
| 1020 | 1020 | } |
| 1021 | 1021 | public function setThumbnailLink($thumbnailLink) |
| 1022 | 1022 | { |
| 1023 | - $this->thumbnailLink = $thumbnailLink; |
|
| 1023 | + $this->thumbnailLink = $thumbnailLink; |
|
| 1024 | 1024 | } |
| 1025 | 1025 | public function getThumbnailLink() |
| 1026 | 1026 | { |
| 1027 | - return $this->thumbnailLink; |
|
| 1027 | + return $this->thumbnailLink; |
|
| 1028 | 1028 | } |
| 1029 | 1029 | public function setThumbnailWidth($thumbnailWidth) |
| 1030 | 1030 | { |
| 1031 | - $this->thumbnailWidth = $thumbnailWidth; |
|
| 1031 | + $this->thumbnailWidth = $thumbnailWidth; |
|
| 1032 | 1032 | } |
| 1033 | 1033 | public function getThumbnailWidth() |
| 1034 | 1034 | { |
| 1035 | - return $this->thumbnailWidth; |
|
| 1035 | + return $this->thumbnailWidth; |
|
| 1036 | 1036 | } |
| 1037 | 1037 | public function setWidth($width) |
| 1038 | 1038 | { |
| 1039 | - $this->width = $width; |
|
| 1039 | + $this->width = $width; |
|
| 1040 | 1040 | } |
| 1041 | 1041 | public function getWidth() |
| 1042 | 1042 | { |
| 1043 | - return $this->width; |
|
| 1043 | + return $this->width; |
|
| 1044 | 1044 | } |
| 1045 | 1045 | } |
| 1046 | 1046 | |
| 1047 | 1047 | class Google_Service_Customsearch_ResultLabels extends Google_Model |
| 1048 | 1048 | { |
| 1049 | 1049 | protected $internal_gapi_mappings = array( |
| 1050 | - "labelWithOp" => "label_with_op", |
|
| 1050 | + "labelWithOp" => "label_with_op", |
|
| 1051 | 1051 | ); |
| 1052 | 1052 | public $displayName; |
| 1053 | 1053 | public $labelWithOp; |
@@ -1056,27 +1056,27 @@ discard block |
||
| 1056 | 1056 | |
| 1057 | 1057 | public function setDisplayName($displayName) |
| 1058 | 1058 | { |
| 1059 | - $this->displayName = $displayName; |
|
| 1059 | + $this->displayName = $displayName; |
|
| 1060 | 1060 | } |
| 1061 | 1061 | public function getDisplayName() |
| 1062 | 1062 | { |
| 1063 | - return $this->displayName; |
|
| 1063 | + return $this->displayName; |
|
| 1064 | 1064 | } |
| 1065 | 1065 | public function setLabelWithOp($labelWithOp) |
| 1066 | 1066 | { |
| 1067 | - $this->labelWithOp = $labelWithOp; |
|
| 1067 | + $this->labelWithOp = $labelWithOp; |
|
| 1068 | 1068 | } |
| 1069 | 1069 | public function getLabelWithOp() |
| 1070 | 1070 | { |
| 1071 | - return $this->labelWithOp; |
|
| 1071 | + return $this->labelWithOp; |
|
| 1072 | 1072 | } |
| 1073 | 1073 | public function setName($name) |
| 1074 | 1074 | { |
| 1075 | - $this->name = $name; |
|
| 1075 | + $this->name = $name; |
|
| 1076 | 1076 | } |
| 1077 | 1077 | public function getName() |
| 1078 | 1078 | { |
| 1079 | - return $this->name; |
|
| 1079 | + return $this->name; |
|
| 1080 | 1080 | } |
| 1081 | 1081 | } |
| 1082 | 1082 | |
@@ -1112,67 +1112,67 @@ discard block |
||
| 1112 | 1112 | |
| 1113 | 1113 | public function setContext(Google_Service_Customsearch_Context $context) |
| 1114 | 1114 | { |
| 1115 | - $this->context = $context; |
|
| 1115 | + $this->context = $context; |
|
| 1116 | 1116 | } |
| 1117 | 1117 | public function getContext() |
| 1118 | 1118 | { |
| 1119 | - return $this->context; |
|
| 1119 | + return $this->context; |
|
| 1120 | 1120 | } |
| 1121 | 1121 | public function setItems($items) |
| 1122 | 1122 | { |
| 1123 | - $this->items = $items; |
|
| 1123 | + $this->items = $items; |
|
| 1124 | 1124 | } |
| 1125 | 1125 | public function getItems() |
| 1126 | 1126 | { |
| 1127 | - return $this->items; |
|
| 1127 | + return $this->items; |
|
| 1128 | 1128 | } |
| 1129 | 1129 | public function setKind($kind) |
| 1130 | 1130 | { |
| 1131 | - $this->kind = $kind; |
|
| 1131 | + $this->kind = $kind; |
|
| 1132 | 1132 | } |
| 1133 | 1133 | public function getKind() |
| 1134 | 1134 | { |
| 1135 | - return $this->kind; |
|
| 1135 | + return $this->kind; |
|
| 1136 | 1136 | } |
| 1137 | 1137 | public function setPromotions($promotions) |
| 1138 | 1138 | { |
| 1139 | - $this->promotions = $promotions; |
|
| 1139 | + $this->promotions = $promotions; |
|
| 1140 | 1140 | } |
| 1141 | 1141 | public function getPromotions() |
| 1142 | 1142 | { |
| 1143 | - return $this->promotions; |
|
| 1143 | + return $this->promotions; |
|
| 1144 | 1144 | } |
| 1145 | 1145 | public function setQueries($queries) |
| 1146 | 1146 | { |
| 1147 | - $this->queries = $queries; |
|
| 1147 | + $this->queries = $queries; |
|
| 1148 | 1148 | } |
| 1149 | 1149 | public function getQueries() |
| 1150 | 1150 | { |
| 1151 | - return $this->queries; |
|
| 1151 | + return $this->queries; |
|
| 1152 | 1152 | } |
| 1153 | 1153 | public function setSearchInformation(Google_Service_Customsearch_SearchSearchInformation $searchInformation) |
| 1154 | 1154 | { |
| 1155 | - $this->searchInformation = $searchInformation; |
|
| 1155 | + $this->searchInformation = $searchInformation; |
|
| 1156 | 1156 | } |
| 1157 | 1157 | public function getSearchInformation() |
| 1158 | 1158 | { |
| 1159 | - return $this->searchInformation; |
|
| 1159 | + return $this->searchInformation; |
|
| 1160 | 1160 | } |
| 1161 | 1161 | public function setSpelling(Google_Service_Customsearch_SearchSpelling $spelling) |
| 1162 | 1162 | { |
| 1163 | - $this->spelling = $spelling; |
|
| 1163 | + $this->spelling = $spelling; |
|
| 1164 | 1164 | } |
| 1165 | 1165 | public function getSpelling() |
| 1166 | 1166 | { |
| 1167 | - return $this->spelling; |
|
| 1167 | + return $this->spelling; |
|
| 1168 | 1168 | } |
| 1169 | 1169 | public function setUrl(Google_Service_Customsearch_SearchUrl $url) |
| 1170 | 1170 | { |
| 1171 | - $this->url = $url; |
|
| 1171 | + $this->url = $url; |
|
| 1172 | 1172 | } |
| 1173 | 1173 | public function getUrl() |
| 1174 | 1174 | { |
| 1175 | - return $this->url; |
|
| 1175 | + return $this->url; |
|
| 1176 | 1176 | } |
| 1177 | 1177 | } |
| 1178 | 1178 | |
@@ -1192,35 +1192,35 @@ discard block |
||
| 1192 | 1192 | |
| 1193 | 1193 | public function setFormattedSearchTime($formattedSearchTime) |
| 1194 | 1194 | { |
| 1195 | - $this->formattedSearchTime = $formattedSearchTime; |
|
| 1195 | + $this->formattedSearchTime = $formattedSearchTime; |
|
| 1196 | 1196 | } |
| 1197 | 1197 | public function getFormattedSearchTime() |
| 1198 | 1198 | { |
| 1199 | - return $this->formattedSearchTime; |
|
| 1199 | + return $this->formattedSearchTime; |
|
| 1200 | 1200 | } |
| 1201 | 1201 | public function setFormattedTotalResults($formattedTotalResults) |
| 1202 | 1202 | { |
| 1203 | - $this->formattedTotalResults = $formattedTotalResults; |
|
| 1203 | + $this->formattedTotalResults = $formattedTotalResults; |
|
| 1204 | 1204 | } |
| 1205 | 1205 | public function getFormattedTotalResults() |
| 1206 | 1206 | { |
| 1207 | - return $this->formattedTotalResults; |
|
| 1207 | + return $this->formattedTotalResults; |
|
| 1208 | 1208 | } |
| 1209 | 1209 | public function setSearchTime($searchTime) |
| 1210 | 1210 | { |
| 1211 | - $this->searchTime = $searchTime; |
|
| 1211 | + $this->searchTime = $searchTime; |
|
| 1212 | 1212 | } |
| 1213 | 1213 | public function getSearchTime() |
| 1214 | 1214 | { |
| 1215 | - return $this->searchTime; |
|
| 1215 | + return $this->searchTime; |
|
| 1216 | 1216 | } |
| 1217 | 1217 | public function setTotalResults($totalResults) |
| 1218 | 1218 | { |
| 1219 | - $this->totalResults = $totalResults; |
|
| 1219 | + $this->totalResults = $totalResults; |
|
| 1220 | 1220 | } |
| 1221 | 1221 | public function getTotalResults() |
| 1222 | 1222 | { |
| 1223 | - return $this->totalResults; |
|
| 1223 | + return $this->totalResults; |
|
| 1224 | 1224 | } |
| 1225 | 1225 | } |
| 1226 | 1226 | |
@@ -1234,19 +1234,19 @@ discard block |
||
| 1234 | 1234 | |
| 1235 | 1235 | public function setCorrectedQuery($correctedQuery) |
| 1236 | 1236 | { |
| 1237 | - $this->correctedQuery = $correctedQuery; |
|
| 1237 | + $this->correctedQuery = $correctedQuery; |
|
| 1238 | 1238 | } |
| 1239 | 1239 | public function getCorrectedQuery() |
| 1240 | 1240 | { |
| 1241 | - return $this->correctedQuery; |
|
| 1241 | + return $this->correctedQuery; |
|
| 1242 | 1242 | } |
| 1243 | 1243 | public function setHtmlCorrectedQuery($htmlCorrectedQuery) |
| 1244 | 1244 | { |
| 1245 | - $this->htmlCorrectedQuery = $htmlCorrectedQuery; |
|
| 1245 | + $this->htmlCorrectedQuery = $htmlCorrectedQuery; |
|
| 1246 | 1246 | } |
| 1247 | 1247 | public function getHtmlCorrectedQuery() |
| 1248 | 1248 | { |
| 1249 | - return $this->htmlCorrectedQuery; |
|
| 1249 | + return $this->htmlCorrectedQuery; |
|
| 1250 | 1250 | } |
| 1251 | 1251 | } |
| 1252 | 1252 | |
@@ -1260,18 +1260,18 @@ discard block |
||
| 1260 | 1260 | |
| 1261 | 1261 | public function setTemplate($template) |
| 1262 | 1262 | { |
| 1263 | - $this->template = $template; |
|
| 1263 | + $this->template = $template; |
|
| 1264 | 1264 | } |
| 1265 | 1265 | public function getTemplate() |
| 1266 | 1266 | { |
| 1267 | - return $this->template; |
|
| 1267 | + return $this->template; |
|
| 1268 | 1268 | } |
| 1269 | 1269 | public function setType($type) |
| 1270 | 1270 | { |
| 1271 | - $this->type = $type; |
|
| 1271 | + $this->type = $type; |
|
| 1272 | 1272 | } |
| 1273 | 1273 | public function getType() |
| 1274 | 1274 | { |
| 1275 | - return $this->type; |
|
| 1275 | + return $this->type; |
|
| 1276 | 1276 | } |
| 1277 | 1277 | } |
@@ -43,23 +43,23 @@ discard block |
||
| 43 | 43 | * @param array|null $retryMap Map of errors with retry counts. |
| 44 | 44 | */ |
| 45 | 45 | public function __construct( |
| 46 | - $message, |
|
| 47 | - $code = 0, |
|
| 48 | - Exception $previous = null, |
|
| 49 | - $errors = array(), |
|
| 50 | - array $retryMap = null |
|
| 46 | + $message, |
|
| 47 | + $code = 0, |
|
| 48 | + Exception $previous = null, |
|
| 49 | + $errors = array(), |
|
| 50 | + array $retryMap = null |
|
| 51 | 51 | ) { |
| 52 | - if (version_compare(PHP_VERSION, '5.3.0') >= 0) { |
|
| 53 | - parent::__construct($message, $code, $previous); |
|
| 54 | - } else { |
|
| 55 | - parent::__construct($message, $code); |
|
| 56 | - } |
|
| 52 | + if (version_compare(PHP_VERSION, '5.3.0') >= 0) { |
|
| 53 | + parent::__construct($message, $code, $previous); |
|
| 54 | + } else { |
|
| 55 | + parent::__construct($message, $code); |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - $this->errors = $errors; |
|
| 58 | + $this->errors = $errors; |
|
| 59 | 59 | |
| 60 | - if (is_array($retryMap)) { |
|
| 61 | - $this->retryMap = $retryMap; |
|
| 62 | - } |
|
| 60 | + if (is_array($retryMap)) { |
|
| 61 | + $this->retryMap = $retryMap; |
|
| 62 | + } |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /** |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | */ |
| 78 | 78 | public function getErrors() |
| 79 | 79 | { |
| 80 | - return $this->errors; |
|
| 80 | + return $this->errors; |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /** |
@@ -89,17 +89,17 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | public function allowedRetries() |
| 91 | 91 | { |
| 92 | - if (isset($this->retryMap[$this->code])) { |
|
| 93 | - return $this->retryMap[$this->code]; |
|
| 94 | - } |
|
| 92 | + if (isset($this->retryMap[$this->code])) { |
|
| 93 | + return $this->retryMap[$this->code]; |
|
| 94 | + } |
|
| 95 | 95 | |
| 96 | - $errors = $this->getErrors(); |
|
| 96 | + $errors = $this->getErrors(); |
|
| 97 | 97 | |
| 98 | - if (!empty($errors) && isset($errors[0]['reason']) && |
|
| 99 | - isset($this->retryMap[$errors[0]['reason']])) { |
|
| 100 | - return $this->retryMap[$errors[0]['reason']]; |
|
| 101 | - } |
|
| 98 | + if (!empty($errors) && isset($errors[0]['reason']) && |
|
| 99 | + isset($this->retryMap[$errors[0]['reason']])) { |
|
| 100 | + return $this->retryMap[$errors[0]['reason']]; |
|
| 101 | + } |
|
| 102 | 102 | |
| 103 | - return 0; |
|
| 103 | + return 0; |
|
| 104 | 104 | } |
| 105 | 105 | } |
@@ -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_IO_Exception extends Google_Exception implements Google_Task_Retryable |
@@ -34,61 +34,61 @@ |
||
| 34 | 34 | // Creates a new signer from a .p12 file. |
| 35 | 35 | public function __construct($p12, $password) |
| 36 | 36 | { |
| 37 | - if (!function_exists('openssl_x509_read')) { |
|
| 38 | - throw new Google_Exception( |
|
| 39 | - 'The Google PHP API library needs the openssl PHP extension' |
|
| 40 | - ); |
|
| 41 | - } |
|
| 37 | + if (!function_exists('openssl_x509_read')) { |
|
| 38 | + throw new Google_Exception( |
|
| 39 | + 'The Google PHP API library needs the openssl PHP extension' |
|
| 40 | + ); |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - // If the private key is provided directly, then this isn't in the p12 |
|
| 44 | - // format. Different versions of openssl support different p12 formats |
|
| 45 | - // and the key from google wasn't being accepted by the version available |
|
| 46 | - // at the time. |
|
| 47 | - if (!$password && strpos($p12, "-----BEGIN RSA PRIVATE KEY-----") !== false) { |
|
| 48 | - $this->privateKey = openssl_pkey_get_private($p12); |
|
| 49 | - } elseif ($password === 'notasecret' && strpos($p12, "-----BEGIN PRIVATE KEY-----") !== false) { |
|
| 50 | - $this->privateKey = openssl_pkey_get_private($p12); |
|
| 51 | - } else { |
|
| 52 | - // This throws on error |
|
| 53 | - $certs = array(); |
|
| 54 | - if (!openssl_pkcs12_read($p12, $certs, $password)) { |
|
| 55 | - throw new Google_Auth_Exception( |
|
| 56 | - "Unable to parse the p12 file. " . |
|
| 57 | - "Is this a .p12 file? Is the password correct? OpenSSL error: " . |
|
| 58 | - openssl_error_string() |
|
| 59 | - ); |
|
| 60 | - } |
|
| 61 | - // TODO(beaton): is this part of the contract for the openssl_pkcs12_read |
|
| 62 | - // method? What happens if there are multiple private keys? Do we care? |
|
| 63 | - if (!array_key_exists("pkey", $certs) || !$certs["pkey"]) { |
|
| 64 | - throw new Google_Auth_Exception("No private key found in p12 file."); |
|
| 65 | - } |
|
| 66 | - $this->privateKey = openssl_pkey_get_private($certs['pkey']); |
|
| 67 | - } |
|
| 43 | + // If the private key is provided directly, then this isn't in the p12 |
|
| 44 | + // format. Different versions of openssl support different p12 formats |
|
| 45 | + // and the key from google wasn't being accepted by the version available |
|
| 46 | + // at the time. |
|
| 47 | + if (!$password && strpos($p12, "-----BEGIN RSA PRIVATE KEY-----") !== false) { |
|
| 48 | + $this->privateKey = openssl_pkey_get_private($p12); |
|
| 49 | + } elseif ($password === 'notasecret' && strpos($p12, "-----BEGIN PRIVATE KEY-----") !== false) { |
|
| 50 | + $this->privateKey = openssl_pkey_get_private($p12); |
|
| 51 | + } else { |
|
| 52 | + // This throws on error |
|
| 53 | + $certs = array(); |
|
| 54 | + if (!openssl_pkcs12_read($p12, $certs, $password)) { |
|
| 55 | + throw new Google_Auth_Exception( |
|
| 56 | + "Unable to parse the p12 file. " . |
|
| 57 | + "Is this a .p12 file? Is the password correct? OpenSSL error: " . |
|
| 58 | + openssl_error_string() |
|
| 59 | + ); |
|
| 60 | + } |
|
| 61 | + // TODO(beaton): is this part of the contract for the openssl_pkcs12_read |
|
| 62 | + // method? What happens if there are multiple private keys? Do we care? |
|
| 63 | + if (!array_key_exists("pkey", $certs) || !$certs["pkey"]) { |
|
| 64 | + throw new Google_Auth_Exception("No private key found in p12 file."); |
|
| 65 | + } |
|
| 66 | + $this->privateKey = openssl_pkey_get_private($certs['pkey']); |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | - if (!$this->privateKey) { |
|
| 70 | - throw new Google_Auth_Exception("Unable to load private key"); |
|
| 71 | - } |
|
| 69 | + if (!$this->privateKey) { |
|
| 70 | + throw new Google_Auth_Exception("Unable to load private key"); |
|
| 71 | + } |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | public function __destruct() |
| 75 | 75 | { |
| 76 | - if ($this->privateKey) { |
|
| 77 | - openssl_pkey_free($this->privateKey); |
|
| 78 | - } |
|
| 76 | + if ($this->privateKey) { |
|
| 77 | + openssl_pkey_free($this->privateKey); |
|
| 78 | + } |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | public function sign($data) |
| 82 | 82 | { |
| 83 | - if (version_compare(PHP_VERSION, '5.3.0') < 0) { |
|
| 84 | - throw new Google_Auth_Exception( |
|
| 85 | - "PHP 5.3.0 or higher is required to use service accounts." |
|
| 86 | - ); |
|
| 87 | - } |
|
| 88 | - $hash = defined("OPENSSL_ALGO_SHA256") ? OPENSSL_ALGO_SHA256 : "sha256"; |
|
| 89 | - if (!openssl_sign($data, $signature, $this->privateKey, $hash)) { |
|
| 90 | - throw new Google_Auth_Exception("Unable to sign data"); |
|
| 91 | - } |
|
| 92 | - return $signature; |
|
| 83 | + if (version_compare(PHP_VERSION, '5.3.0') < 0) { |
|
| 84 | + throw new Google_Auth_Exception( |
|
| 85 | + "PHP 5.3.0 or higher is required to use service accounts." |
|
| 86 | + ); |
|
| 87 | + } |
|
| 88 | + $hash = defined("OPENSSL_ALGO_SHA256") ? OPENSSL_ALGO_SHA256 : "sha256"; |
|
| 89 | + if (!openssl_sign($data, $signature, $this->privateKey, $hash)) { |
|
| 90 | + throw new Google_Auth_Exception("Unable to sign data"); |
|
| 91 | + } |
|
| 92 | + return $signature; |
|
| 93 | 93 | } |
| 94 | 94 | } |
@@ -16,7 +16,7 @@ discard block |
||
| 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,8 +53,8 @@ discard block |
||
| 53 | 53 | $certs = array(); |
| 54 | 54 | if (!openssl_pkcs12_read($p12, $certs, $password)) { |
| 55 | 55 | throw new Google_Auth_Exception( |
| 56 | - "Unable to parse the p12 file. " . |
|
| 57 | - "Is this a .p12 file? Is the password correct? OpenSSL error: " . |
|
| 56 | + "Unable to parse the p12 file. ". |
|
| 57 | + "Is this a .p12 file? Is the password correct? OpenSSL error: ". |
|
| 58 | 58 | openssl_error_string() |
| 59 | 59 | ); |
| 60 | 60 | } |
@@ -32,13 +32,13 @@ discard block |
||
| 32 | 32 | * processed. |
| 33 | 33 | */ |
| 34 | 34 | private $operators = array( |
| 35 | - "+" => "reserved", |
|
| 36 | - "/" => "segments", |
|
| 37 | - "." => "dotprefix", |
|
| 38 | - "#" => "fragment", |
|
| 39 | - ";" => "semicolon", |
|
| 40 | - "?" => "form", |
|
| 41 | - "&" => "continuation" |
|
| 35 | + "+" => "reserved", |
|
| 36 | + "/" => "segments", |
|
| 37 | + "." => "dotprefix", |
|
| 38 | + "#" => "fragment", |
|
| 39 | + ";" => "semicolon", |
|
| 40 | + "?" => "form", |
|
| 41 | + "&" => "continuation" |
|
| 42 | 42 | ); |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -47,18 +47,18 @@ discard block |
||
| 47 | 47 | * strings. |
| 48 | 48 | */ |
| 49 | 49 | private $reserved = array( |
| 50 | - "=", ",", "!", "@", "|", ":", "/", "?", "#", |
|
| 51 | - "[", "]",'$', "&", "'", "(", ")", "*", "+", ";" |
|
| 50 | + "=", ",", "!", "@", "|", ":", "/", "?", "#", |
|
| 51 | + "[", "]",'$', "&", "'", "(", ")", "*", "+", ";" |
|
| 52 | 52 | ); |
| 53 | 53 | private $reservedEncoded = array( |
| 54 | - "%3D", "%2C", "%21", "%40", "%7C", "%3A", "%2F", "%3F", |
|
| 55 | - "%23", "%5B", "%5D", "%24", "%26", "%27", "%28", "%29", |
|
| 56 | - "%2A", "%2B", "%3B" |
|
| 54 | + "%3D", "%2C", "%21", "%40", "%7C", "%3A", "%2F", "%3F", |
|
| 55 | + "%23", "%5B", "%5D", "%24", "%26", "%27", "%28", "%29", |
|
| 56 | + "%2A", "%2B", "%3B" |
|
| 57 | 57 | ); |
| 58 | 58 | |
| 59 | 59 | public function parse($string, array $parameters) |
| 60 | 60 | { |
| 61 | - return $this->resolveNextSection($string, $parameters); |
|
| 61 | + return $this->resolveNextSection($string, $parameters); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /** |
@@ -68,208 +68,208 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | private function resolveNextSection($string, $parameters) |
| 70 | 70 | { |
| 71 | - $start = strpos($string, "{"); |
|
| 72 | - if ($start === false) { |
|
| 73 | - return $string; |
|
| 74 | - } |
|
| 75 | - $end = strpos($string, "}"); |
|
| 76 | - if ($end === false) { |
|
| 77 | - return $string; |
|
| 78 | - } |
|
| 79 | - $string = $this->replace($string, $start, $end, $parameters); |
|
| 80 | - return $this->resolveNextSection($string, $parameters); |
|
| 71 | + $start = strpos($string, "{"); |
|
| 72 | + if ($start === false) { |
|
| 73 | + return $string; |
|
| 74 | + } |
|
| 75 | + $end = strpos($string, "}"); |
|
| 76 | + if ($end === false) { |
|
| 77 | + return $string; |
|
| 78 | + } |
|
| 79 | + $string = $this->replace($string, $start, $end, $parameters); |
|
| 80 | + return $this->resolveNextSection($string, $parameters); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | private function replace($string, $start, $end, $parameters) |
| 84 | 84 | { |
| 85 | - // We know a data block will have {} round it, so we can strip that. |
|
| 86 | - $data = substr($string, $start + 1, $end - $start - 1); |
|
| 85 | + // We know a data block will have {} round it, so we can strip that. |
|
| 86 | + $data = substr($string, $start + 1, $end - $start - 1); |
|
| 87 | 87 | |
| 88 | - // If the first character is one of the reserved operators, it effects |
|
| 89 | - // the processing of the stream. |
|
| 90 | - if (isset($this->operators[$data[0]])) { |
|
| 91 | - $op = $this->operators[$data[0]]; |
|
| 92 | - $data = substr($data, 1); |
|
| 93 | - $prefix = ""; |
|
| 94 | - $prefix_on_missing = false; |
|
| 88 | + // If the first character is one of the reserved operators, it effects |
|
| 89 | + // the processing of the stream. |
|
| 90 | + if (isset($this->operators[$data[0]])) { |
|
| 91 | + $op = $this->operators[$data[0]]; |
|
| 92 | + $data = substr($data, 1); |
|
| 93 | + $prefix = ""; |
|
| 94 | + $prefix_on_missing = false; |
|
| 95 | 95 | |
| 96 | - switch ($op) { |
|
| 97 | - case "reserved": |
|
| 98 | - // Reserved means certain characters should not be URL encoded |
|
| 99 | - $data = $this->replaceVars($data, $parameters, ",", null, true); |
|
| 100 | - break; |
|
| 101 | - case "fragment": |
|
| 102 | - // Comma separated with fragment prefix. Bare values only. |
|
| 103 | - $prefix = "#"; |
|
| 104 | - $prefix_on_missing = true; |
|
| 105 | - $data = $this->replaceVars($data, $parameters, ",", null, true); |
|
| 106 | - break; |
|
| 107 | - case "segments": |
|
| 108 | - // Slash separated data. Bare values only. |
|
| 109 | - $prefix = "/"; |
|
| 110 | - $data =$this->replaceVars($data, $parameters, "/"); |
|
| 111 | - break; |
|
| 112 | - case "dotprefix": |
|
| 113 | - // Dot separated data. Bare values only. |
|
| 114 | - $prefix = "."; |
|
| 115 | - $prefix_on_missing = true; |
|
| 116 | - $data = $this->replaceVars($data, $parameters, "."); |
|
| 117 | - break; |
|
| 118 | - case "semicolon": |
|
| 119 | - // Semicolon prefixed and separated. Uses the key name |
|
| 120 | - $prefix = ";"; |
|
| 121 | - $data = $this->replaceVars($data, $parameters, ";", "=", false, true, false); |
|
| 122 | - break; |
|
| 123 | - case "form": |
|
| 124 | - // Standard URL format. Uses the key name |
|
| 125 | - $prefix = "?"; |
|
| 126 | - $data = $this->replaceVars($data, $parameters, "&", "="); |
|
| 127 | - break; |
|
| 128 | - case "continuation": |
|
| 129 | - // Standard URL, but with leading ampersand. Uses key name. |
|
| 130 | - $prefix = "&"; |
|
| 131 | - $data = $this->replaceVars($data, $parameters, "&", "="); |
|
| 132 | - break; |
|
| 133 | - } |
|
| 96 | + switch ($op) { |
|
| 97 | + case "reserved": |
|
| 98 | + // Reserved means certain characters should not be URL encoded |
|
| 99 | + $data = $this->replaceVars($data, $parameters, ",", null, true); |
|
| 100 | + break; |
|
| 101 | + case "fragment": |
|
| 102 | + // Comma separated with fragment prefix. Bare values only. |
|
| 103 | + $prefix = "#"; |
|
| 104 | + $prefix_on_missing = true; |
|
| 105 | + $data = $this->replaceVars($data, $parameters, ",", null, true); |
|
| 106 | + break; |
|
| 107 | + case "segments": |
|
| 108 | + // Slash separated data. Bare values only. |
|
| 109 | + $prefix = "/"; |
|
| 110 | + $data =$this->replaceVars($data, $parameters, "/"); |
|
| 111 | + break; |
|
| 112 | + case "dotprefix": |
|
| 113 | + // Dot separated data. Bare values only. |
|
| 114 | + $prefix = "."; |
|
| 115 | + $prefix_on_missing = true; |
|
| 116 | + $data = $this->replaceVars($data, $parameters, "."); |
|
| 117 | + break; |
|
| 118 | + case "semicolon": |
|
| 119 | + // Semicolon prefixed and separated. Uses the key name |
|
| 120 | + $prefix = ";"; |
|
| 121 | + $data = $this->replaceVars($data, $parameters, ";", "=", false, true, false); |
|
| 122 | + break; |
|
| 123 | + case "form": |
|
| 124 | + // Standard URL format. Uses the key name |
|
| 125 | + $prefix = "?"; |
|
| 126 | + $data = $this->replaceVars($data, $parameters, "&", "="); |
|
| 127 | + break; |
|
| 128 | + case "continuation": |
|
| 129 | + // Standard URL, but with leading ampersand. Uses key name. |
|
| 130 | + $prefix = "&"; |
|
| 131 | + $data = $this->replaceVars($data, $parameters, "&", "="); |
|
| 132 | + break; |
|
| 133 | + } |
|
| 134 | 134 | |
| 135 | - // Add the initial prefix character if data is valid. |
|
| 136 | - if ($data || ($data !== false && $prefix_on_missing)) { |
|
| 137 | - $data = $prefix . $data; |
|
| 138 | - } |
|
| 135 | + // Add the initial prefix character if data is valid. |
|
| 136 | + if ($data || ($data !== false && $prefix_on_missing)) { |
|
| 137 | + $data = $prefix . $data; |
|
| 138 | + } |
|
| 139 | 139 | |
| 140 | - } else { |
|
| 141 | - // If no operator we replace with the defaults. |
|
| 142 | - $data = $this->replaceVars($data, $parameters); |
|
| 143 | - } |
|
| 144 | - // This is chops out the {...} and replaces with the new section. |
|
| 145 | - return substr($string, 0, $start) . $data . substr($string, $end + 1); |
|
| 140 | + } else { |
|
| 141 | + // If no operator we replace with the defaults. |
|
| 142 | + $data = $this->replaceVars($data, $parameters); |
|
| 143 | + } |
|
| 144 | + // This is chops out the {...} and replaces with the new section. |
|
| 145 | + return substr($string, 0, $start) . $data . substr($string, $end + 1); |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | private function replaceVars( |
| 149 | - $section, |
|
| 150 | - $parameters, |
|
| 151 | - $sep = ",", |
|
| 152 | - $combine = null, |
|
| 153 | - $reserved = false, |
|
| 154 | - $tag_empty = false, |
|
| 155 | - $combine_on_empty = true |
|
| 149 | + $section, |
|
| 150 | + $parameters, |
|
| 151 | + $sep = ",", |
|
| 152 | + $combine = null, |
|
| 153 | + $reserved = false, |
|
| 154 | + $tag_empty = false, |
|
| 155 | + $combine_on_empty = true |
|
| 156 | 156 | ) { |
| 157 | - if (strpos($section, ",") === false) { |
|
| 158 | - // If we only have a single value, we can immediately process. |
|
| 159 | - return $this->combine( |
|
| 160 | - $section, |
|
| 161 | - $parameters, |
|
| 162 | - $sep, |
|
| 163 | - $combine, |
|
| 164 | - $reserved, |
|
| 165 | - $tag_empty, |
|
| 166 | - $combine_on_empty |
|
| 167 | - ); |
|
| 168 | - } else { |
|
| 169 | - // If we have multiple values, we need to split and loop over them. |
|
| 170 | - // Each is treated individually, then glued together with the |
|
| 171 | - // separator character. |
|
| 172 | - $vars = explode(",", $section); |
|
| 173 | - return $this->combineList( |
|
| 174 | - $vars, |
|
| 175 | - $sep, |
|
| 176 | - $parameters, |
|
| 177 | - $combine, |
|
| 178 | - $reserved, |
|
| 179 | - false, // Never emit empty strings in multi-param replacements |
|
| 180 | - $combine_on_empty |
|
| 181 | - ); |
|
| 182 | - } |
|
| 157 | + if (strpos($section, ",") === false) { |
|
| 158 | + // If we only have a single value, we can immediately process. |
|
| 159 | + return $this->combine( |
|
| 160 | + $section, |
|
| 161 | + $parameters, |
|
| 162 | + $sep, |
|
| 163 | + $combine, |
|
| 164 | + $reserved, |
|
| 165 | + $tag_empty, |
|
| 166 | + $combine_on_empty |
|
| 167 | + ); |
|
| 168 | + } else { |
|
| 169 | + // If we have multiple values, we need to split and loop over them. |
|
| 170 | + // Each is treated individually, then glued together with the |
|
| 171 | + // separator character. |
|
| 172 | + $vars = explode(",", $section); |
|
| 173 | + return $this->combineList( |
|
| 174 | + $vars, |
|
| 175 | + $sep, |
|
| 176 | + $parameters, |
|
| 177 | + $combine, |
|
| 178 | + $reserved, |
|
| 179 | + false, // Never emit empty strings in multi-param replacements |
|
| 180 | + $combine_on_empty |
|
| 181 | + ); |
|
| 182 | + } |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | public function combine( |
| 186 | - $key, |
|
| 187 | - $parameters, |
|
| 188 | - $sep, |
|
| 189 | - $combine, |
|
| 190 | - $reserved, |
|
| 191 | - $tag_empty, |
|
| 192 | - $combine_on_empty |
|
| 186 | + $key, |
|
| 187 | + $parameters, |
|
| 188 | + $sep, |
|
| 189 | + $combine, |
|
| 190 | + $reserved, |
|
| 191 | + $tag_empty, |
|
| 192 | + $combine_on_empty |
|
| 193 | 193 | ) { |
| 194 | - $length = false; |
|
| 195 | - $explode = false; |
|
| 196 | - $skip_final_combine = false; |
|
| 197 | - $value = false; |
|
| 194 | + $length = false; |
|
| 195 | + $explode = false; |
|
| 196 | + $skip_final_combine = false; |
|
| 197 | + $value = false; |
|
| 198 | 198 | |
| 199 | - // Check for length restriction. |
|
| 200 | - if (strpos($key, ":") !== false) { |
|
| 201 | - list($key, $length) = explode(":", $key); |
|
| 202 | - } |
|
| 199 | + // Check for length restriction. |
|
| 200 | + if (strpos($key, ":") !== false) { |
|
| 201 | + list($key, $length) = explode(":", $key); |
|
| 202 | + } |
|
| 203 | 203 | |
| 204 | - // Check for explode parameter. |
|
| 205 | - if ($key[strlen($key) - 1] == "*") { |
|
| 206 | - $explode = true; |
|
| 207 | - $key = substr($key, 0, -1); |
|
| 208 | - $skip_final_combine = true; |
|
| 209 | - } |
|
| 204 | + // Check for explode parameter. |
|
| 205 | + if ($key[strlen($key) - 1] == "*") { |
|
| 206 | + $explode = true; |
|
| 207 | + $key = substr($key, 0, -1); |
|
| 208 | + $skip_final_combine = true; |
|
| 209 | + } |
|
| 210 | 210 | |
| 211 | - // Define the list separator. |
|
| 212 | - $list_sep = $explode ? $sep : ","; |
|
| 211 | + // Define the list separator. |
|
| 212 | + $list_sep = $explode ? $sep : ","; |
|
| 213 | 213 | |
| 214 | - if (isset($parameters[$key])) { |
|
| 215 | - $data_type = $this->getDataType($parameters[$key]); |
|
| 216 | - switch ($data_type) { |
|
| 217 | - case self::TYPE_SCALAR: |
|
| 218 | - $value = $this->getValue($parameters[$key], $length); |
|
| 219 | - break; |
|
| 220 | - case self::TYPE_LIST: |
|
| 221 | - $values = array(); |
|
| 222 | - foreach ($parameters[$key] as $pkey => $pvalue) { |
|
| 223 | - $pvalue = $this->getValue($pvalue, $length); |
|
| 224 | - if ($combine && $explode) { |
|
| 225 | - $values[$pkey] = $key . $combine . $pvalue; |
|
| 226 | - } else { |
|
| 227 | - $values[$pkey] = $pvalue; |
|
| 228 | - } |
|
| 229 | - } |
|
| 230 | - $value = implode($list_sep, $values); |
|
| 231 | - if ($value == '') { |
|
| 232 | - return ''; |
|
| 233 | - } |
|
| 234 | - break; |
|
| 235 | - case self::TYPE_MAP: |
|
| 236 | - $values = array(); |
|
| 237 | - foreach ($parameters[$key] as $pkey => $pvalue) { |
|
| 238 | - $pvalue = $this->getValue($pvalue, $length); |
|
| 239 | - if ($explode) { |
|
| 240 | - $pkey = $this->getValue($pkey, $length); |
|
| 241 | - $values[] = $pkey . "=" . $pvalue; // Explode triggers = combine. |
|
| 242 | - } else { |
|
| 243 | - $values[] = $pkey; |
|
| 244 | - $values[] = $pvalue; |
|
| 245 | - } |
|
| 246 | - } |
|
| 247 | - $value = implode($list_sep, $values); |
|
| 248 | - if ($value == '') { |
|
| 249 | - return false; |
|
| 250 | - } |
|
| 251 | - break; |
|
| 252 | - } |
|
| 253 | - } else if ($tag_empty) { |
|
| 254 | - // If we are just indicating empty values with their key name, return that. |
|
| 255 | - return $key; |
|
| 256 | - } else { |
|
| 257 | - // Otherwise we can skip this variable due to not being defined. |
|
| 258 | - return false; |
|
| 259 | - } |
|
| 214 | + if (isset($parameters[$key])) { |
|
| 215 | + $data_type = $this->getDataType($parameters[$key]); |
|
| 216 | + switch ($data_type) { |
|
| 217 | + case self::TYPE_SCALAR: |
|
| 218 | + $value = $this->getValue($parameters[$key], $length); |
|
| 219 | + break; |
|
| 220 | + case self::TYPE_LIST: |
|
| 221 | + $values = array(); |
|
| 222 | + foreach ($parameters[$key] as $pkey => $pvalue) { |
|
| 223 | + $pvalue = $this->getValue($pvalue, $length); |
|
| 224 | + if ($combine && $explode) { |
|
| 225 | + $values[$pkey] = $key . $combine . $pvalue; |
|
| 226 | + } else { |
|
| 227 | + $values[$pkey] = $pvalue; |
|
| 228 | + } |
|
| 229 | + } |
|
| 230 | + $value = implode($list_sep, $values); |
|
| 231 | + if ($value == '') { |
|
| 232 | + return ''; |
|
| 233 | + } |
|
| 234 | + break; |
|
| 235 | + case self::TYPE_MAP: |
|
| 236 | + $values = array(); |
|
| 237 | + foreach ($parameters[$key] as $pkey => $pvalue) { |
|
| 238 | + $pvalue = $this->getValue($pvalue, $length); |
|
| 239 | + if ($explode) { |
|
| 240 | + $pkey = $this->getValue($pkey, $length); |
|
| 241 | + $values[] = $pkey . "=" . $pvalue; // Explode triggers = combine. |
|
| 242 | + } else { |
|
| 243 | + $values[] = $pkey; |
|
| 244 | + $values[] = $pvalue; |
|
| 245 | + } |
|
| 246 | + } |
|
| 247 | + $value = implode($list_sep, $values); |
|
| 248 | + if ($value == '') { |
|
| 249 | + return false; |
|
| 250 | + } |
|
| 251 | + break; |
|
| 252 | + } |
|
| 253 | + } else if ($tag_empty) { |
|
| 254 | + // If we are just indicating empty values with their key name, return that. |
|
| 255 | + return $key; |
|
| 256 | + } else { |
|
| 257 | + // Otherwise we can skip this variable due to not being defined. |
|
| 258 | + return false; |
|
| 259 | + } |
|
| 260 | 260 | |
| 261 | - if ($reserved) { |
|
| 262 | - $value = str_replace($this->reservedEncoded, $this->reserved, $value); |
|
| 263 | - } |
|
| 261 | + if ($reserved) { |
|
| 262 | + $value = str_replace($this->reservedEncoded, $this->reserved, $value); |
|
| 263 | + } |
|
| 264 | 264 | |
| 265 | - // If we do not need to include the key name, we just return the raw |
|
| 266 | - // value. |
|
| 267 | - if (!$combine || $skip_final_combine) { |
|
| 268 | - return $value; |
|
| 269 | - } |
|
| 265 | + // If we do not need to include the key name, we just return the raw |
|
| 266 | + // value. |
|
| 267 | + if (!$combine || $skip_final_combine) { |
|
| 268 | + return $value; |
|
| 269 | + } |
|
| 270 | 270 | |
| 271 | - // Else we combine the key name: foo=bar, if value is not the empty string. |
|
| 272 | - return $key . ($value != '' || $combine_on_empty ? $combine . $value : ''); |
|
| 271 | + // Else we combine the key name: foo=bar, if value is not the empty string. |
|
| 272 | + return $key . ($value != '' || $combine_on_empty ? $combine . $value : ''); |
|
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | /** |
@@ -277,14 +277,14 @@ discard block |
||
| 277 | 277 | */ |
| 278 | 278 | private function getDataType($data) |
| 279 | 279 | { |
| 280 | - if (is_array($data)) { |
|
| 281 | - reset($data); |
|
| 282 | - if (key($data) !== 0) { |
|
| 283 | - return self::TYPE_MAP; |
|
| 284 | - } |
|
| 285 | - return self::TYPE_LIST; |
|
| 286 | - } |
|
| 287 | - return self::TYPE_SCALAR; |
|
| 280 | + if (is_array($data)) { |
|
| 281 | + reset($data); |
|
| 282 | + if (key($data) !== 0) { |
|
| 283 | + return self::TYPE_MAP; |
|
| 284 | + } |
|
| 285 | + return self::TYPE_LIST; |
|
| 286 | + } |
|
| 287 | + return self::TYPE_SCALAR; |
|
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | /** |
@@ -292,31 +292,31 @@ discard block |
||
| 292 | 292 | * for multi-key templates. |
| 293 | 293 | */ |
| 294 | 294 | private function combineList( |
| 295 | - $vars, |
|
| 296 | - $sep, |
|
| 297 | - $parameters, |
|
| 298 | - $combine, |
|
| 299 | - $reserved, |
|
| 300 | - $tag_empty, |
|
| 301 | - $combine_on_empty |
|
| 295 | + $vars, |
|
| 296 | + $sep, |
|
| 297 | + $parameters, |
|
| 298 | + $combine, |
|
| 299 | + $reserved, |
|
| 300 | + $tag_empty, |
|
| 301 | + $combine_on_empty |
|
| 302 | 302 | ) { |
| 303 | - $ret = array(); |
|
| 304 | - foreach ($vars as $var) { |
|
| 305 | - $response = $this->combine( |
|
| 306 | - $var, |
|
| 307 | - $parameters, |
|
| 308 | - $sep, |
|
| 309 | - $combine, |
|
| 310 | - $reserved, |
|
| 311 | - $tag_empty, |
|
| 312 | - $combine_on_empty |
|
| 313 | - ); |
|
| 314 | - if ($response === false) { |
|
| 315 | - continue; |
|
| 316 | - } |
|
| 317 | - $ret[] = $response; |
|
| 318 | - } |
|
| 319 | - return implode($sep, $ret); |
|
| 303 | + $ret = array(); |
|
| 304 | + foreach ($vars as $var) { |
|
| 305 | + $response = $this->combine( |
|
| 306 | + $var, |
|
| 307 | + $parameters, |
|
| 308 | + $sep, |
|
| 309 | + $combine, |
|
| 310 | + $reserved, |
|
| 311 | + $tag_empty, |
|
| 312 | + $combine_on_empty |
|
| 313 | + ); |
|
| 314 | + if ($response === false) { |
|
| 315 | + continue; |
|
| 316 | + } |
|
| 317 | + $ret[] = $response; |
|
| 318 | + } |
|
| 319 | + return implode($sep, $ret); |
|
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | /** |
@@ -324,10 +324,10 @@ discard block |
||
| 324 | 324 | */ |
| 325 | 325 | private function getValue($value, $length) |
| 326 | 326 | { |
| 327 | - if ($length) { |
|
| 328 | - $value = substr($value, 0, $length); |
|
| 329 | - } |
|
| 330 | - $value = rawurlencode($value); |
|
| 331 | - return $value; |
|
| 327 | + if ($length) { |
|
| 328 | + $value = substr($value, 0, $length); |
|
| 329 | + } |
|
| 330 | + $value = rawurlencode($value); |
|
| 331 | + return $value; |
|
| 332 | 332 | } |
| 333 | 333 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | private $reserved = array( |
| 50 | 50 | "=", ",", "!", "@", "|", ":", "/", "?", "#", |
| 51 | - "[", "]",'$', "&", "'", "(", ")", "*", "+", ";" |
|
| 51 | + "[", "]", '$', "&", "'", "(", ")", "*", "+", ";" |
|
| 52 | 52 | ); |
| 53 | 53 | private $reservedEncoded = array( |
| 54 | 54 | "%3D", "%2C", "%21", "%40", "%7C", "%3A", "%2F", "%3F", |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | case "segments": |
| 108 | 108 | // Slash separated data. Bare values only. |
| 109 | 109 | $prefix = "/"; |
| 110 | - $data =$this->replaceVars($data, $parameters, "/"); |
|
| 110 | + $data = $this->replaceVars($data, $parameters, "/"); |
|
| 111 | 111 | break; |
| 112 | 112 | case "dotprefix": |
| 113 | 113 | // Dot separated data. Bare values only. |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | // Add the initial prefix character if data is valid. |
| 136 | 136 | if ($data || ($data !== false && $prefix_on_missing)) { |
| 137 | - $data = $prefix . $data; |
|
| 137 | + $data = $prefix.$data; |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | } else { |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | $data = $this->replaceVars($data, $parameters); |
| 143 | 143 | } |
| 144 | 144 | // This is chops out the {...} and replaces with the new section. |
| 145 | - return substr($string, 0, $start) . $data . substr($string, $end + 1); |
|
| 145 | + return substr($string, 0, $start).$data.substr($string, $end + 1); |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | private function replaceVars( |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | foreach ($parameters[$key] as $pkey => $pvalue) { |
| 223 | 223 | $pvalue = $this->getValue($pvalue, $length); |
| 224 | 224 | if ($combine && $explode) { |
| 225 | - $values[$pkey] = $key . $combine . $pvalue; |
|
| 225 | + $values[$pkey] = $key.$combine.$pvalue; |
|
| 226 | 226 | } else { |
| 227 | 227 | $values[$pkey] = $pvalue; |
| 228 | 228 | } |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | $pvalue = $this->getValue($pvalue, $length); |
| 239 | 239 | if ($explode) { |
| 240 | 240 | $pkey = $this->getValue($pkey, $length); |
| 241 | - $values[] = $pkey . "=" . $pvalue; // Explode triggers = combine. |
|
| 241 | + $values[] = $pkey."=".$pvalue; // Explode triggers = combine. |
|
| 242 | 242 | } else { |
| 243 | 243 | $values[] = $pkey; |
| 244 | 244 | $values[] = $pvalue; |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | // Else we combine the key name: foo=bar, if value is not the empty string. |
| 272 | - return $key . ($value != '' || $combine_on_empty ? $combine . $value : ''); |
|
| 272 | + return $key.($value != '' || $combine_on_empty ? $combine.$value : ''); |
|
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | /** |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | public function __construct($envelope, $payload) |
| 44 | 44 | { |
| 45 | - $this->envelope = $envelope; |
|
| 46 | - $this->payload = $payload; |
|
| 45 | + $this->envelope = $envelope; |
|
| 46 | + $this->payload = $payload; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -53,10 +53,10 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function getUserId() |
| 55 | 55 | { |
| 56 | - if (array_key_exists(self::USER_ATTR, $this->payload)) { |
|
| 57 | - return $this->payload[self::USER_ATTR]; |
|
| 58 | - } |
|
| 59 | - throw new Google_Auth_Exception("No user_id in token"); |
|
| 56 | + if (array_key_exists(self::USER_ATTR, $this->payload)) { |
|
| 57 | + return $this->payload[self::USER_ATTR]; |
|
| 58 | + } |
|
| 59 | + throw new Google_Auth_Exception("No user_id in token"); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /** |
@@ -66,6 +66,6 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | public function getAttributes() |
| 68 | 68 | { |
| 69 | - return array("envelope" => $this->envelope, "payload" => $this->payload); |
|
| 69 | + return array("envelope" => $this->envelope, "payload" => $this->payload); |
|
| 70 | 70 | } |
| 71 | 71 | } |
@@ -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_IO_Exception extends Google_Exception implements Google_Task_Retryable |
@@ -51,22 +51,22 @@ discard block |
||
| 51 | 51 | * automatic caching of the generated token. |
| 52 | 52 | */ |
| 53 | 53 | public function __construct( |
| 54 | - $serviceAccountName, |
|
| 55 | - $scopes, |
|
| 56 | - $privateKey, |
|
| 57 | - $privateKeyPassword = 'notasecret', |
|
| 58 | - $assertionType = 'http://oauth.net/grant_type/jwt/1.0/bearer', |
|
| 59 | - $sub = false, |
|
| 60 | - $useCache = true |
|
| 54 | + $serviceAccountName, |
|
| 55 | + $scopes, |
|
| 56 | + $privateKey, |
|
| 57 | + $privateKeyPassword = 'notasecret', |
|
| 58 | + $assertionType = 'http://oauth.net/grant_type/jwt/1.0/bearer', |
|
| 59 | + $sub = false, |
|
| 60 | + $useCache = true |
|
| 61 | 61 | ) { |
| 62 | - $this->serviceAccountName = $serviceAccountName; |
|
| 63 | - $this->scopes = is_string($scopes) ? $scopes : implode(' ', $scopes); |
|
| 64 | - $this->privateKey = $privateKey; |
|
| 65 | - $this->privateKeyPassword = $privateKeyPassword; |
|
| 66 | - $this->assertionType = $assertionType; |
|
| 67 | - $this->sub = $sub; |
|
| 68 | - $this->prn = $sub; |
|
| 69 | - $this->useCache = $useCache; |
|
| 62 | + $this->serviceAccountName = $serviceAccountName; |
|
| 63 | + $this->scopes = is_string($scopes) ? $scopes : implode(' ', $scopes); |
|
| 64 | + $this->privateKey = $privateKey; |
|
| 65 | + $this->privateKeyPassword = $privateKeyPassword; |
|
| 66 | + $this->assertionType = $assertionType; |
|
| 67 | + $this->sub = $sub; |
|
| 68 | + $this->prn = $sub; |
|
| 69 | + $this->useCache = $useCache; |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
@@ -75,36 +75,36 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function getCacheKey() |
| 77 | 77 | { |
| 78 | - if (!$this->useCache) { |
|
| 79 | - return false; |
|
| 80 | - } |
|
| 81 | - $h = $this->sub; |
|
| 82 | - $h .= $this->assertionType; |
|
| 83 | - $h .= $this->privateKey; |
|
| 84 | - $h .= $this->scopes; |
|
| 85 | - $h .= $this->serviceAccountName; |
|
| 86 | - return md5($h); |
|
| 78 | + if (!$this->useCache) { |
|
| 79 | + return false; |
|
| 80 | + } |
|
| 81 | + $h = $this->sub; |
|
| 82 | + $h .= $this->assertionType; |
|
| 83 | + $h .= $this->privateKey; |
|
| 84 | + $h .= $this->scopes; |
|
| 85 | + $h .= $this->serviceAccountName; |
|
| 86 | + return md5($h); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | public function generateAssertion() |
| 90 | 90 | { |
| 91 | - $now = time(); |
|
| 91 | + $now = time(); |
|
| 92 | 92 | |
| 93 | - $jwtParams = array( |
|
| 94 | - 'aud' => Google_Auth_OAuth2::OAUTH2_TOKEN_URI, |
|
| 95 | - 'scope' => $this->scopes, |
|
| 96 | - 'iat' => $now, |
|
| 97 | - 'exp' => $now + self::MAX_TOKEN_LIFETIME_SECS, |
|
| 98 | - 'iss' => $this->serviceAccountName, |
|
| 99 | - ); |
|
| 93 | + $jwtParams = array( |
|
| 94 | + 'aud' => Google_Auth_OAuth2::OAUTH2_TOKEN_URI, |
|
| 95 | + 'scope' => $this->scopes, |
|
| 96 | + 'iat' => $now, |
|
| 97 | + 'exp' => $now + self::MAX_TOKEN_LIFETIME_SECS, |
|
| 98 | + 'iss' => $this->serviceAccountName, |
|
| 99 | + ); |
|
| 100 | 100 | |
| 101 | - if ($this->sub !== false) { |
|
| 102 | - $jwtParams['sub'] = $this->sub; |
|
| 103 | - } else if ($this->prn !== false) { |
|
| 104 | - $jwtParams['prn'] = $this->prn; |
|
| 105 | - } |
|
| 101 | + if ($this->sub !== false) { |
|
| 102 | + $jwtParams['sub'] = $this->sub; |
|
| 103 | + } else if ($this->prn !== false) { |
|
| 104 | + $jwtParams['prn'] = $this->prn; |
|
| 105 | + } |
|
| 106 | 106 | |
| 107 | - return $this->makeSignedJwt($jwtParams); |
|
| 107 | + return $this->makeSignedJwt($jwtParams); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
@@ -114,23 +114,23 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | private function makeSignedJwt($payload) |
| 116 | 116 | { |
| 117 | - $header = array('typ' => 'JWT', 'alg' => 'RS256'); |
|
| 117 | + $header = array('typ' => 'JWT', 'alg' => 'RS256'); |
|
| 118 | 118 | |
| 119 | - $payload = json_encode($payload); |
|
| 120 | - // Handle some overzealous escaping in PHP json that seemed to cause some errors |
|
| 121 | - // with claimsets. |
|
| 122 | - $payload = str_replace('\/', '/', $payload); |
|
| 119 | + $payload = json_encode($payload); |
|
| 120 | + // Handle some overzealous escaping in PHP json that seemed to cause some errors |
|
| 121 | + // with claimsets. |
|
| 122 | + $payload = str_replace('\/', '/', $payload); |
|
| 123 | 123 | |
| 124 | - $segments = array( |
|
| 125 | - Google_Utils::urlSafeB64Encode(json_encode($header)), |
|
| 126 | - Google_Utils::urlSafeB64Encode($payload) |
|
| 127 | - ); |
|
| 124 | + $segments = array( |
|
| 125 | + Google_Utils::urlSafeB64Encode(json_encode($header)), |
|
| 126 | + Google_Utils::urlSafeB64Encode($payload) |
|
| 127 | + ); |
|
| 128 | 128 | |
| 129 | - $signingInput = implode('.', $segments); |
|
| 130 | - $signer = new Google_Signer_P12($this->privateKey, $this->privateKeyPassword); |
|
| 131 | - $signature = $signer->sign($signingInput); |
|
| 132 | - $segments[] = Google_Utils::urlSafeB64Encode($signature); |
|
| 129 | + $signingInput = implode('.', $segments); |
|
| 130 | + $signer = new Google_Signer_P12($this->privateKey, $this->privateKeyPassword); |
|
| 131 | + $signature = $signer->sign($signingInput); |
|
| 132 | + $segments[] = Google_Utils::urlSafeB64Encode($signature); |
|
| 133 | 133 | |
| 134 | - return implode(".", $segments); |
|
| 134 | + return implode(".", $segments); |
|
| 135 | 135 | } |
| 136 | 136 | } |
@@ -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_IO_Exception extends Google_Exception implements Google_Task_Retryable |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | public function __construct(Google_Client $client, $config = null) |
| 40 | 40 | { |
| 41 | - $this->client = $client; |
|
| 41 | + $this->client = $client; |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -46,27 +46,27 @@ discard block |
||
| 46 | 46 | */ |
| 47 | 47 | public function authenticateForScope($scopes) |
| 48 | 48 | { |
| 49 | - if ($this->token && $this->tokenScopes == $scopes) { |
|
| 50 | - return $this->token; |
|
| 51 | - } |
|
| 49 | + if ($this->token && $this->tokenScopes == $scopes) { |
|
| 50 | + return $this->token; |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - $cacheKey = self::CACHE_PREFIX; |
|
| 54 | - if (is_string($scopes)) { |
|
| 55 | - $cacheKey .= $scopes; |
|
| 56 | - } else if (is_array($scopes)) { |
|
| 57 | - $cacheKey .= implode(":", $scopes); |
|
| 58 | - } |
|
| 53 | + $cacheKey = self::CACHE_PREFIX; |
|
| 54 | + if (is_string($scopes)) { |
|
| 55 | + $cacheKey .= $scopes; |
|
| 56 | + } else if (is_array($scopes)) { |
|
| 57 | + $cacheKey .= implode(":", $scopes); |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - $this->token = $this->client->getCache()->get($cacheKey); |
|
| 61 | - if (!$this->token) { |
|
| 62 | - $this->retrieveToken($scopes, $cacheKey); |
|
| 63 | - } else if ($this->token['expiration_time'] < time()) { |
|
| 64 | - $this->client->getCache()->delete($cacheKey); |
|
| 65 | - $this->retrieveToken($scopes, $cacheKey); |
|
| 66 | - } |
|
| 60 | + $this->token = $this->client->getCache()->get($cacheKey); |
|
| 61 | + if (!$this->token) { |
|
| 62 | + $this->retrieveToken($scopes, $cacheKey); |
|
| 63 | + } else if ($this->token['expiration_time'] < time()) { |
|
| 64 | + $this->client->getCache()->delete($cacheKey); |
|
| 65 | + $this->retrieveToken($scopes, $cacheKey); |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - $this->tokenScopes = $scopes; |
|
| 69 | - return $this->token; |
|
| 68 | + $this->tokenScopes = $scopes; |
|
| 69 | + return $this->token; |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
@@ -76,13 +76,13 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | private function retrieveToken($scopes, $cacheKey) |
| 78 | 78 | { |
| 79 | - $this->token = AppIdentityService::getAccessToken($scopes); |
|
| 80 | - if ($this->token) { |
|
| 81 | - $this->client->getCache()->set( |
|
| 82 | - $cacheKey, |
|
| 83 | - $this->token |
|
| 84 | - ); |
|
| 85 | - } |
|
| 79 | + $this->token = AppIdentityService::getAccessToken($scopes); |
|
| 80 | + if ($this->token) { |
|
| 81 | + $this->client->getCache()->set( |
|
| 82 | + $cacheKey, |
|
| 83 | + $this->token |
|
| 84 | + ); |
|
| 85 | + } |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | /** |
@@ -97,24 +97,24 @@ discard block |
||
| 97 | 97 | */ |
| 98 | 98 | public function authenticatedRequest(Google_Http_Request $request) |
| 99 | 99 | { |
| 100 | - $request = $this->sign($request); |
|
| 101 | - return $this->client->getIo()->makeRequest($request); |
|
| 100 | + $request = $this->sign($request); |
|
| 101 | + return $this->client->getIo()->makeRequest($request); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | public function sign(Google_Http_Request $request) |
| 105 | 105 | { |
| 106 | - if (!$this->token) { |
|
| 107 | - // No token, so nothing to do. |
|
| 108 | - return $request; |
|
| 109 | - } |
|
| 106 | + if (!$this->token) { |
|
| 107 | + // No token, so nothing to do. |
|
| 108 | + return $request; |
|
| 109 | + } |
|
| 110 | 110 | |
| 111 | - $this->client->getLogger()->debug('App Identity authentication'); |
|
| 111 | + $this->client->getLogger()->debug('App Identity authentication'); |
|
| 112 | 112 | |
| 113 | - // Add the OAuth2 header to the request |
|
| 114 | - $request->setRequestHeaders( |
|
| 115 | - array('Authorization' => 'Bearer ' . $this->token['access_token']) |
|
| 116 | - ); |
|
| 113 | + // Add the OAuth2 header to the request |
|
| 114 | + $request->setRequestHeaders( |
|
| 115 | + array('Authorization' => 'Bearer ' . $this->token['access_token']) |
|
| 116 | + ); |
|
| 117 | 117 | |
| 118 | - return $request; |
|
| 118 | + return $request; |
|
| 119 | 119 | } |
| 120 | 120 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | use google\appengine\api\app_identity\AppIdentityService; |
| 24 | 24 | |
| 25 | 25 | if (!class_exists('Google_Client')) { |
| 26 | - require_once dirname(__FILE__) . '/../autoload.php'; |
|
| 26 | + require_once dirname(__FILE__).'/../autoload.php'; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /** |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | // Add the OAuth2 header to the request |
| 114 | 114 | $request->setRequestHeaders( |
| 115 | - array('Authorization' => 'Bearer ' . $this->token['access_token']) |
|
| 115 | + array('Authorization' => 'Bearer '.$this->token['access_token']) |
|
| 116 | 116 | ); |
| 117 | 117 | |
| 118 | 118 | return $request; |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | public function __construct(Google_Client $client, $config = null) |
| 32 | 32 | { |
| 33 | - $this->client = $client; |
|
| 33 | + $this->client = $client; |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -45,19 +45,19 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | public function authenticatedRequest(Google_Http_Request $request) |
| 47 | 47 | { |
| 48 | - $request = $this->sign($request); |
|
| 49 | - return $this->io->makeRequest($request); |
|
| 48 | + $request = $this->sign($request); |
|
| 49 | + return $this->io->makeRequest($request); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | public function sign(Google_Http_Request $request) |
| 53 | 53 | { |
| 54 | - $key = $this->client->getClassConfig($this, 'developer_key'); |
|
| 55 | - if ($key) { |
|
| 56 | - $this->client->getLogger()->debug( |
|
| 57 | - 'Simple API Access developer key authentication' |
|
| 58 | - ); |
|
| 59 | - $request->setQueryParam('key', $key); |
|
| 60 | - } |
|
| 61 | - return $request; |
|
| 54 | + $key = $this->client->getClassConfig($this, 'developer_key'); |
|
| 55 | + if ($key) { |
|
| 56 | + $this->client->getLogger()->debug( |
|
| 57 | + 'Simple API Access developer key authentication' |
|
| 58 | + ); |
|
| 59 | + $request->setQueryParam('key', $key); |
|
| 60 | + } |
|
| 61 | + return $request; |
|
| 62 | 62 | } |
| 63 | 63 | } |
@@ -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_IO_Exception extends Google_Exception implements Google_Task_Retryable |
@@ -28,13 +28,13 @@ discard block |
||
| 28 | 28 | class Google_Auth_ComputeEngine extends Google_Auth_Abstract |
| 29 | 29 | { |
| 30 | 30 | const METADATA_AUTH_URL = |
| 31 | - 'http://metadata/computeMetadata/v1/instance/service-accounts/default/token'; |
|
| 31 | + 'http://metadata/computeMetadata/v1/instance/service-accounts/default/token'; |
|
| 32 | 32 | private $client; |
| 33 | 33 | private $token; |
| 34 | 34 | |
| 35 | 35 | public function __construct(Google_Client $client, $config = null) |
| 36 | 36 | { |
| 37 | - $this->client = $client; |
|
| 37 | + $this->client = $client; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -49,8 +49,8 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public function authenticatedRequest(Google_Http_Request $request) |
| 51 | 51 | { |
| 52 | - $request = $this->sign($request); |
|
| 53 | - return $this->client->getIo()->makeRequest($request); |
|
| 52 | + $request = $this->sign($request); |
|
| 53 | + return $this->client->getIo()->makeRequest($request); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -59,20 +59,20 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | public function setAccessToken($token) |
| 61 | 61 | { |
| 62 | - $token = json_decode($token, true); |
|
| 63 | - if ($token == null) { |
|
| 64 | - throw new Google_Auth_Exception('Could not json decode the token'); |
|
| 65 | - } |
|
| 66 | - if (! isset($token['access_token'])) { |
|
| 67 | - throw new Google_Auth_Exception("Invalid token format"); |
|
| 68 | - } |
|
| 69 | - $token['created'] = time(); |
|
| 70 | - $this->token = $token; |
|
| 62 | + $token = json_decode($token, true); |
|
| 63 | + if ($token == null) { |
|
| 64 | + throw new Google_Auth_Exception('Could not json decode the token'); |
|
| 65 | + } |
|
| 66 | + if (! isset($token['access_token'])) { |
|
| 67 | + throw new Google_Auth_Exception("Invalid token format"); |
|
| 68 | + } |
|
| 69 | + $token['created'] = time(); |
|
| 70 | + $this->token = $token; |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | public function getAccessToken() |
| 74 | 74 | { |
| 75 | - return json_encode($this->token); |
|
| 75 | + return json_encode($this->token); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
@@ -81,29 +81,29 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | public function acquireAccessToken() |
| 83 | 83 | { |
| 84 | - $request = new Google_Http_Request( |
|
| 85 | - self::METADATA_AUTH_URL, |
|
| 86 | - 'GET', |
|
| 87 | - array( |
|
| 88 | - 'Metadata-Flavor' => 'Google' |
|
| 89 | - ) |
|
| 90 | - ); |
|
| 91 | - $request->disableGzip(); |
|
| 92 | - $response = $this->client->getIo()->makeRequest($request); |
|
| 84 | + $request = new Google_Http_Request( |
|
| 85 | + self::METADATA_AUTH_URL, |
|
| 86 | + 'GET', |
|
| 87 | + array( |
|
| 88 | + 'Metadata-Flavor' => 'Google' |
|
| 89 | + ) |
|
| 90 | + ); |
|
| 91 | + $request->disableGzip(); |
|
| 92 | + $response = $this->client->getIo()->makeRequest($request); |
|
| 93 | 93 | |
| 94 | - if ($response->getResponseHttpCode() == 200) { |
|
| 95 | - $this->setAccessToken($response->getResponseBody()); |
|
| 96 | - $this->token['created'] = time(); |
|
| 97 | - return $this->getAccessToken(); |
|
| 98 | - } else { |
|
| 99 | - throw new Google_Auth_Exception( |
|
| 100 | - sprintf( |
|
| 101 | - "Error fetching service account access token, message: '%s'", |
|
| 102 | - $response->getResponseBody() |
|
| 103 | - ), |
|
| 104 | - $response->getResponseHttpCode() |
|
| 105 | - ); |
|
| 106 | - } |
|
| 94 | + if ($response->getResponseHttpCode() == 200) { |
|
| 95 | + $this->setAccessToken($response->getResponseBody()); |
|
| 96 | + $this->token['created'] = time(); |
|
| 97 | + return $this->getAccessToken(); |
|
| 98 | + } else { |
|
| 99 | + throw new Google_Auth_Exception( |
|
| 100 | + sprintf( |
|
| 101 | + "Error fetching service account access token, message: '%s'", |
|
| 102 | + $response->getResponseBody() |
|
| 103 | + ), |
|
| 104 | + $response->getResponseHttpCode() |
|
| 105 | + ); |
|
| 106 | + } |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
@@ -114,17 +114,17 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | public function sign(Google_Http_Request $request) |
| 116 | 116 | { |
| 117 | - if ($this->isAccessTokenExpired()) { |
|
| 118 | - $this->acquireAccessToken(); |
|
| 119 | - } |
|
| 117 | + if ($this->isAccessTokenExpired()) { |
|
| 118 | + $this->acquireAccessToken(); |
|
| 119 | + } |
|
| 120 | 120 | |
| 121 | - $this->client->getLogger()->debug('Compute engine service account authentication'); |
|
| 121 | + $this->client->getLogger()->debug('Compute engine service account authentication'); |
|
| 122 | 122 | |
| 123 | - $request->setRequestHeaders( |
|
| 124 | - array('Authorization' => 'Bearer ' . $this->token['access_token']) |
|
| 125 | - ); |
|
| 123 | + $request->setRequestHeaders( |
|
| 124 | + array('Authorization' => 'Bearer ' . $this->token['access_token']) |
|
| 125 | + ); |
|
| 126 | 126 | |
| 127 | - return $request; |
|
| 127 | + return $request; |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
@@ -133,14 +133,14 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | public function isAccessTokenExpired() |
| 135 | 135 | { |
| 136 | - if (!$this->token || !isset($this->token['created'])) { |
|
| 137 | - return true; |
|
| 138 | - } |
|
| 136 | + if (!$this->token || !isset($this->token['created'])) { |
|
| 137 | + return true; |
|
| 138 | + } |
|
| 139 | 139 | |
| 140 | - // If the token is set to expire in the next 30 seconds. |
|
| 141 | - $expired = ($this->token['created'] |
|
| 142 | - + ($this->token['expires_in'] - 30)) < time(); |
|
| 140 | + // If the token is set to expire in the next 30 seconds. |
|
| 141 | + $expired = ($this->token['created'] |
|
| 142 | + + ($this->token['expires_in'] - 30)) < time(); |
|
| 143 | 143 | |
| 144 | - return $expired; |
|
| 144 | + return $expired; |
|
| 145 | 145 | } |
| 146 | 146 | } |
@@ -16,7 +16,7 @@ discard block |
||
| 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 | /** |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | if ($token == null) { |
| 64 | 64 | throw new Google_Auth_Exception('Could not json decode the token'); |
| 65 | 65 | } |
| 66 | - if (! isset($token['access_token'])) { |
|
| 66 | + if (!isset($token['access_token'])) { |
|
| 67 | 67 | throw new Google_Auth_Exception("Invalid token format"); |
| 68 | 68 | } |
| 69 | 69 | $token['created'] = time(); |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $this->client->getLogger()->debug('Compute engine service account authentication'); |
| 122 | 122 | |
| 123 | 123 | $request->setRequestHeaders( |
| 124 | - array('Authorization' => 'Bearer ' . $this->token['access_token']) |
|
| 124 | + array('Authorization' => 'Bearer '.$this->token['access_token']) |
|
| 125 | 125 | ); |
| 126 | 126 | |
| 127 | 127 | return $request; |