You are here

public function DirectoryOperations::directoryPrepare in AT Tools 8

Same name and namespace in other branches
  1. 8.3 at_theme_generator/src/File/DirectoryOperations.php \Drupal\at_theme_generator\File\DirectoryOperations::directoryPrepare()
  2. 8.2 at_theme_generator/src/File/DirectoryOperations.php \Drupal\at_theme_generator\File\DirectoryOperations::directoryPrepare()

Build, prepare and return the path for generated files.

Parameters

array $file_path: Numeric array of path parts (directories).

Return value

string Path to the prepared directory/s.

File

at_theme_generator/src/File/DirectoryOperations.php, line 20
Contains \Drupal\at_theme_generator\File\DirectoryOperations

Class

DirectoryOperations

Namespace

Drupal\at_theme_generator\File

Code

public function directoryPrepare($file_path) {
  $directory_path = implode('/', $file_path);
  if (!file_exists($directory_path)) {
    file_prepare_directory($directory_path, FILE_CREATE_DIRECTORY);
  }
  return $directory_path;
}