You are here

public function OauthTokenFileStorage::__construct in Apigee Edge 8

OauthTokenFileStorage constructor.

Parameters

\Drupal\Core\Config\ConfigFactoryInterface $config: The config factory service.

\Drupal\Core\File\FileSystemInterface $file_system: The file system service.

\Drupal\Core\Logger\LoggerChannelInterface $logger: The logger service.

File

src/OauthTokenFileStorage.php, line 92

Class

OauthTokenFileStorage
Stores OAuth token data in a file.

Namespace

Drupal\apigee_edge

Code

public function __construct(ConfigFactoryInterface $config, FileSystemInterface $file_system, LoggerChannelInterface $logger) {
  $custom_path = $config
    ->get('apigee_edge.auth')
    ->get('oauth_token_storage_location');
  $this->tokenFilePath = empty($custom_path) ? static::DEFAULT_DIRECTORY : rtrim(trim($custom_path), " \\/");
  $this->tokenFilePath .= '/oauth.dat';
  $this->fileSystem = $file_system;
  $this->logger = $logger;
}