You are here

function FMDiskFileSystem::createDir in N1ED - Visual editor as CKEditor plugin with Bootstrap support 7

Overrides IFMDiskFileSystem::createDir

File

vendor/edsdk/flmngr-server-php/src/fs/FMDiskFileSystem.php, line 135

Class

FMDiskFileSystem

Namespace

EdSDK\FlmngrServer\fs

Code

function createDir($dirPath, $name) {
  if (strpos($name, "..") !== FALSE || strpos($name, "/") !== FALSE) {
    throw new MessageException(FMMessage::createMessage(FMMessage::FM_DIR_NAME_CONTAINS_INVALID_SYMBOLS));
  }
  $fullPath = $this
    ->getAbsolutePath($dirPath) . "/" . $name;
  $res = mkdir($fullPath, 0777, TRUE);
  if ($res === FALSE) {
    throw new MessageException(FMMessage::createMessage(FMMessage::FM_UNABLE_TO_CREATE_DIRECTORY));
  }
}