You are here

private function ResponsiveFaviconsAdmin::extractDirectory in Responsive Favicons 8

Gets the directory where responsive favicons zip files should be extracted.

Parameters

bool $create: (optional) Whether to attempt to create the directory if it does not already exist. Defaults to TRUE.

Return value

string The full path to the temporary directory where responsive favicons fil archives should be extracted.

1 call to ResponsiveFaviconsAdmin::extractDirectory()
ResponsiveFaviconsAdmin::submitForm in src/Form/ResponsiveFaviconsAdmin.php
Form submission handler.

File

src/Form/ResponsiveFaviconsAdmin.php, line 287

Class

ResponsiveFaviconsAdmin
Class ResponsiveFaviconsAdmin.

Namespace

Drupal\responsive_favicons\Form

Code

private function extractDirectory($create = TRUE) {
  $directory =& drupal_static(__FUNCTION__, '');
  if (empty($directory)) {
    $directory = 'temporary://responsive-favicons-' . $this
      ->uniqueIdentifier();
    if ($create && !file_exists($directory)) {
      mkdir($directory);
    }
  }
  return $directory;
}