You are here

public function ServletConfig::getTmpDir in N1ED - Visual editor as CKEditor plugin with Bootstrap support 8.2

Gets a path to temporary directory.

Overrides ConfigInterface::getTmpDir

File

src/Flmngr/FileUploaderServer/servlet/ServletConfig.php, line 105

Class

ServletConfig
Implementation of ConfigInterface interface. Returnes values with validationing them.

Namespace

Drupal\n1ed\Flmngr\FileUploaderServer\servlet

Code

public function getTmpDir() {
  $dir = $this
    ->getParameter("dirTmp", $this
    ->getBaseDir() . "/tmp", TRUE);
  if (!file_exists($dir)) {
    if (!mkdir($dir)) {
      throw new Exception("Unable to create temporary files directory '" . $dir . "''");
    }
  }
  return UtilsPHP::normalizeNoEndSeparator($dir);
}