Skip to content

Commit 73eb630

Browse files
committed
Merge pull request googleglass#12 from googleglass/upgrade-client-lib
Upgraded PHP API client library to 0.6.6 (which enables XE8 features), s...
2 parents 44f7561 + 8a23429 commit 73eb630

File tree

82 files changed

+29748
-11809
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+29748
-11809
lines changed

google-api-php-client/LICENSE

100755100644
File mode changed.

google-api-php-client/NOTICE

100755100644
File mode changed.

google-api-php-client/README

100755100644
File mode changed.

google-api-php-client/src/Google_Client.php

100755100644
Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,8 @@
1515
* limitations under the License.
1616
*/
1717

18-
// Check for the required json and curl extensions, the Google APIs PHP Client
19-
// won't function without them.
20-
if (! function_exists('curl_init')) {
21-
throw new Exception('Google PHP API Client requires the CURL PHP extension');
22-
}
23-
18+
// Check for the json extension, the Google APIs PHP Client won't function
19+
// without it.
2420
if (! function_exists('json_decode')) {
2521
throw new Exception('Google PHP API Client requires the JSON PHP extension');
2622
}
@@ -365,6 +361,19 @@ public function getScopes() {
365361
return $this->scopes;
366362
}
367363

364+
/**
365+
* If 'plus.login' is included in the list of requested scopes, you can use
366+
* this method to define types of app activities that your app will write.
367+
* You can find a list of available types here:
368+
* @link https://developers.google.com/+/api/moment-types
369+
*
370+
* @param array $requestVisibleActions Array of app activity types
371+
*/
372+
public function setRequestVisibleActions($requestVisibleActions) {
373+
self::$auth->requestVisibleActions =
374+
join(" ", $requestVisibleActions);
375+
}
376+
368377
/**
369378
* Declare if objects should be returned by the api service classes.
370379
*

google-api-php-client/src/auth/Google_AssertionCredentials.php

100755100644
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ class Google_AssertionCredentials {
4343
* @param string $assertionType
4444
* @param bool|string $sub The email address of the user for which the
4545
* application is requesting delegated access.
46-
*
4746
*/
4847
public function __construct(
4948
$serviceAccountName,

google-api-php-client/src/auth/Google_Auth.php

100755100644
File mode changed.

google-api-php-client/src/auth/Google_AuthNone.php

100755100644
File mode changed.

google-api-php-client/src/auth/Google_LoginTicket.php

100755100644
File mode changed.

google-api-php-client/src/auth/Google_OAuth2.php

100755100644
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class Google_OAuth2 extends Google_Auth {
3535
public $state;
3636
public $accessType = 'offline';
3737
public $approvalPrompt = 'force';
38+
public $requestVisibleActions;
3839

3940
/** @var Google_AssertionCredentials $assertionCredentials */
4041
public $assertionCredentials;
@@ -137,6 +138,13 @@ public function createAuthUrl($scope) {
137138
'approval_prompt=' . urlencode($this->approvalPrompt),
138139
);
139140

141+
// if the list of scopes contains plus.login, add request_visible_actions
142+
// to auth URL
143+
if(strpos($scope, 'plus.login') && count($this->requestVisibleActions) > 0) {
144+
$params[] = 'request_visible_actions=' .
145+
urlencode($this->requestVisibleActions);
146+
}
147+
140148
if (isset($this->state)) {
141149
$params[] = 'state=' . urlencode($this->state);
142150
}

google-api-php-client/src/auth/Google_P12Signer.php

100755100644
File mode changed.

google-api-php-client/src/auth/Google_PemVerifier.php

100755100644
File mode changed.

google-api-php-client/src/auth/Google_Signer.php

100755100644
File mode changed.

google-api-php-client/src/auth/Google_Verifier.php

100755100644
File mode changed.

google-api-php-client/src/cache/Google_ApcCache.php

100755100644
File mode changed.

google-api-php-client/src/cache/Google_Cache.php

100755100644
File mode changed.

google-api-php-client/src/cache/Google_FileCache.php

100755100644
File mode changed.

google-api-php-client/src/cache/Google_MemcacheCache.php

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function get($key, $expiration = false) {
9797
if (($ret = @memcache_get($this->connection, $key)) === false) {
9898
return false;
9999
}
100-
if (! $expiration || (time() - $ret['time'] > $expiration)) {
100+
if (is_numeric($expiration) && (time() - $ret['time'] > $expiration)) {
101101
$this->delete($key);
102102
return false;
103103
}

google-api-php-client/src/config.php

100755100644
File mode changed.

google-api-php-client/src/contrib/Google_AdExchangeSellerService.php

100755100644
Lines changed: 63 additions & 65 deletions
Large diffs are not rendered by default.

google-api-php-client/src/contrib/Google_AdexchangebuyerService.php

100755100644
Lines changed: 138 additions & 43 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)