You are here

protected function SmartlingApi::readFile in TMGMT Translator Smartling 8

OOP wrapper for fopen() function.

Parameters

string $realPath: Real path for file.

Return value

resource

Throws

\Drupal\tmgmt_smartling\Smartling\SmartlingApiException

1 call to SmartlingApi::readFile()
SmartlingApi::sendRequest in src/Smartling/SmartlingApi.php
Sends request to Smartling Service via Guzzle Client.

File

src/Smartling/SmartlingApi.php, line 469

Class

SmartlingApi

Namespace

Drupal\tmgmt_smartling\Smartling

Code

protected function readFile($realPath) {
  $stream = @fopen($realPath, 'r');
  if (!$stream) {
    throw new SmartlingApiException("File {$realPath} was not able to be read.");
  }
  else {
    return $stream;
  }
}