You are here

private function OauthTokenFileStorage::getFromStorage in Apigee Edge 8

Reads the token data from the file.

Return value

array The token data from the file or an empty array if file does not exist.

1 call to OauthTokenFileStorage::getFromStorage()
OauthTokenFileStorage::getTokenData in src/OauthTokenFileStorage.php
Gets the token data from the cache or the file.

File

src/OauthTokenFileStorage.php, line 262

Class

OauthTokenFileStorage
Stores OAuth token data in a file.

Namespace

Drupal\apigee_edge

Code

private function getFromStorage() : array {
  $data = [];

  // Get the token data from the file store.
  if (file_exists($this->tokenFilePath) && ($raw_data = file_get_contents($this->tokenFilePath))) {
    $data = unserialize(base64_decode($raw_data));
  }
  return is_array($data) ? $data : [];
}