Skip to content

Commit

Permalink
Fix for PHP autoloader failing to find key file in some instances (Th…
Browse files Browse the repository at this point in the history
…anks @lukyrys)
  • Loading branch information
erebusnz committed Jun 13, 2015
1 parent 6846b06 commit 075fc52
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gapi.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,11 @@ public function fetchToken($client_email, $key_file, $delegate_email = null) {
$data = $this->base64URLEncode(json_encode($header)) . '.' . $this->base64URLEncode(json_encode($claimset));

if (!file_exists($key_file)) {
throw new Exception('GAPI: Failed load key file "' . $key_file . '". File could not be found.');
if ( !file_exists(__DIR__ . DIRECTORY_SEPARATOR . $key_file) ) {
throw new Exception('GAPI: Failed load key file "' . $key_file . '". File could not be found.');
} else {
$key_file = __DIR__ . DIRECTORY_SEPARATOR . $key_file;
}
}

$key_data = file_get_contents($key_file);
Expand Down

0 comments on commit 075fc52

Please sign in to comment.