You are here

public function LogFileManager::ensurePath in File Log 8

Same name in this branch
  1. 8 src/LogFileManager.php \Drupal\filelog\LogFileManager::ensurePath()
  2. 8 src/ProxyClass/LogFileManager.php \Drupal\filelog\ProxyClass\LogFileManager::ensurePath()
Same name and namespace in other branches
  1. 2.0.x src/LogFileManager.php \Drupal\filelog\LogFileManager::ensurePath()

Ensure that the log directory exists.

Return value

bool TRUE if the path of the logfile exists and is writeable.

Overrides LogFileManagerInterface::ensurePath

File

src/LogFileManager.php, line 55

Class

LogFileManager
Provide file-handling methods for the logfile.

Namespace

Drupal\filelog

Code

public function ensurePath() : bool {
  $path = $this->config
    ->get('location');
  return $this->fileSystem
    ->prepareDirectory($path, FileSystemInterface::CREATE_DIRECTORY);
}