You are here

public function ContentSynchronizerManager::tarGzExists in Content Synchronizer 3.x

Test if tar.gz exists.

Parameters

string $value: The path.

Return value

string The path

File

src/Service/ContentSynchronizerManager.php, line 437

Class

ContentSynchronizerManager
ContentSynchronizerManager service.

Namespace

Drupal\content_synchronizer\Service

Code

public function tarGzExists($value) {
  if (!file_exists($value)) {
    throw new \Exception($value . ' does not exist');
  }
  if (strpos($value, '.tar.gz') === FALSE) {
    throw new \Exception($value . ' is not a .tar.gz file');
  }
  return $value;
}