Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #12 from googleglass/upgrade-client-lib
Browse files Browse the repository at this point in the history
Upgraded PHP API client library to 0.6.6 (which enables XE8 features), s...
  • Loading branch information
allevato committed Aug 16, 2013
2 parents 44f7561 + 8a23429 commit 73eb630
Show file tree
Hide file tree
Showing 82 changed files with 29,748 additions and 11,809 deletions.
Empty file modified google-api-php-client/LICENSE
100755 → 100644
Empty file.
Empty file modified google-api-php-client/NOTICE
100755 → 100644
Empty file.
Empty file modified google-api-php-client/README
100755 → 100644
Empty file.
21 changes: 15 additions & 6 deletions google-api-php-client/src/Google_Client.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@
* limitations under the License.
*/

// Check for the required json and curl extensions, the Google APIs PHP Client
// won't function without them.
if (! function_exists('curl_init')) {
throw new Exception('Google PHP API Client requires the CURL PHP extension');
}

// Check for the json extension, the Google APIs PHP Client won't function
// without it.
if (! function_exists('json_decode')) {
throw new Exception('Google PHP API Client requires the JSON PHP extension');
}
Expand Down Expand Up @@ -365,6 +361,19 @@ public function getScopes() {
return $this->scopes;
}

/**
* If 'plus.login' is included in the list of requested scopes, you can use
* this method to define types of app activities that your app will write.
* You can find a list of available types here:
* @link https://developers.google.com/+/api/moment-types
*
* @param array $requestVisibleActions Array of app activity types
*/
public function setRequestVisibleActions($requestVisibleActions) {
self::$auth->requestVisibleActions =
join(" ", $requestVisibleActions);
}

/**
* Declare if objects should be returned by the api service classes.
*
Expand Down
1 change: 0 additions & 1 deletion google-api-php-client/src/auth/Google_AssertionCredentials.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class Google_AssertionCredentials {
* @param string $assertionType
* @param bool|string $sub The email address of the user for which the
* application is requesting delegated access.
*
*/
public function __construct(
$serviceAccountName,
Expand Down
Empty file modified google-api-php-client/src/auth/Google_Auth.php
100755 → 100644
Empty file.
Empty file modified google-api-php-client/src/auth/Google_AuthNone.php
100755 → 100644
Empty file.
Empty file modified google-api-php-client/src/auth/Google_LoginTicket.php
100755 → 100644
Empty file.
8 changes: 8 additions & 0 deletions google-api-php-client/src/auth/Google_OAuth2.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class Google_OAuth2 extends Google_Auth {
public $state;
public $accessType = 'offline';
public $approvalPrompt = 'force';
public $requestVisibleActions;

/** @var Google_AssertionCredentials $assertionCredentials */
public $assertionCredentials;
Expand Down Expand Up @@ -137,6 +138,13 @@ public function createAuthUrl($scope) {
'approval_prompt=' . urlencode($this->approvalPrompt),
);

// if the list of scopes contains plus.login, add request_visible_actions
// to auth URL
if(strpos($scope, 'plus.login') && count($this->requestVisibleActions) > 0) {
$params[] = 'request_visible_actions=' .
urlencode($this->requestVisibleActions);
}

if (isset($this->state)) {
$params[] = 'state=' . urlencode($this->state);
}
Expand Down
Empty file modified google-api-php-client/src/auth/Google_P12Signer.php
100755 → 100644
Empty file.
Empty file modified google-api-php-client/src/auth/Google_PemVerifier.php
100755 → 100644
Empty file.
Empty file modified google-api-php-client/src/auth/Google_Signer.php
100755 → 100644
Empty file.
Empty file modified google-api-php-client/src/auth/Google_Verifier.php
100755 → 100644
Empty file.
Empty file modified google-api-php-client/src/cache/Google_ApcCache.php
100755 → 100644
Empty file.
Empty file modified google-api-php-client/src/cache/Google_Cache.php
100755 → 100644
Empty file.
Empty file modified google-api-php-client/src/cache/Google_FileCache.php
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion google-api-php-client/src/cache/Google_MemcacheCache.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function get($key, $expiration = false) {
if (($ret = @memcache_get($this->connection, $key)) === false) {
return false;
}
if (! $expiration || (time() - $ret['time'] > $expiration)) {
if (is_numeric($expiration) && (time() - $ret['time'] > $expiration)) {
$this->delete($key);
return false;
}
Expand Down
Empty file modified google-api-php-client/src/config.php
100755 → 100644
Empty file.
128 changes: 63 additions & 65 deletions google-api-php-client/src/contrib/Google_AdExchangeSellerService.php
100755 → 100644

Large diffs are not rendered by default.

181 changes: 138 additions & 43 deletions google-api-php-client/src/contrib/Google_AdexchangebuyerService.php
100755 → 100644

Large diffs are not rendered by default.

Loading

0 comments on commit 73eb630

Please sign in to comment.