You are here

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

Gets a path to base directory.

Overrides ConfigInterface::getBaseDir

1 call to ServletConfig::getBaseDir()
ServletConfig::getTmpDir in src/Flmngr/FileUploaderServer/servlet/ServletConfig.php
Gets a path to temporary directory.

File

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

Class

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

Namespace

Drupal\n1ed\Flmngr\FileUploaderServer\servlet

Code

public function getBaseDir() {
  $dir = $this
    ->getParameter("dirFiles", NULL, TRUE);
  if ($dir == NULL) {
    throw new Exception("dirFiles not set");
  }
  if (!file_exists($dir)) {
    if (!mkdir($dir, 0777, TRUE)) {
      throw new Exception("Unable to create files directory '" . $dir . "''");
    }
  }
  return UtilsPHP::normalizeNoEndSeparator($dir);
}