You are here

private function TarArchiveReader::createDir in Backup and Migrate 5.0.x

Create a directory or return true if it already exists.

Parameters

$directory:

Return value

bool

1 call to TarArchiveReader::createDir()
TarArchiveReader::extractAllToDirectory in src/Core/Service/TarArchiveReader.php

File

src/Core/Service/TarArchiveReader.php, line 226

Class

TarArchiveReader
@package Drupal\backup_migrate\Core\Service

Namespace

Drupal\backup_migrate\Core\Service

Code

private function createDir($directory) {
  if (@is_dir($directory) || $directory == '') {
    return TRUE;
  }
  $parent = dirname($directory);
  if ($parent != $directory && $parent != '' && !$this
    ->createDir($parent)) {
    return FALSE;
  }
  if (@(!mkdir($directory, 0777))) {
    return FALSE;
  }
  return TRUE;
}