public function mkdir(string $directory, int $mode = null): bool {
    if (!empty($directory)) {
      if ($folders = explode(DIRECTORY_SEPARATOR, Path::replaceOSSeparator($directory))) {
        $fullpath = null;
        if (empty($mode)) {
          $mode = AccessMode::MOD_0777;
        }
        foreach ($folders as $folder) {
          if (!empty($folder)) {
            $fullpath .= DIRECTORY_SEPARATOR . $folder;
            $this->createDirectory($fullpath, $mode);
          }
        }
      }
    }
    return file_exists($directory);
  }
public function mkdir(string $directory, int $mode = null): bool {
    if (!empty($directory)) {
      if ($folders = explode(DIRECTORY_SEPARATOR, Path::replaceOSSeparator($directory))) {
        $fullpath = null;
        if (empty($mode)) {
          $mode = AccessMode::MOD_0777;
        }
        foreach ($folders as $folder) {
          if (!empty($folder)) {
            $fullpath .= DIRECTORY_SEPARATOR . $folder;
            $this->createDirectory($fullpath, $mode);
          }
        }
      }
    }
    return file_exists($directory);
  }
public function mkdir ( string $ directory , int $ mode = null ) : bool { if ( ! empty ( $ directory ) ) { if ( $ folders = explode ( DIRECTORY_SEPARATOR , Path :: replaceOSSeparator ( $ directory ) ) ) { $ fullpath = null ; if ( empty ( $ mode ) ) { $ mode = AccessMode :: MOD_0777 ; } foreach ( $ folders as $ folder ) { if ( ! empty ( $ folder ) ) { $ fullpath .= DIRECTORY_SEPARATOR . $ folder ; $ this -> createDirectory ( $ fullpath , $ mode ) ; } } } } return file_exists ( $ directory ) ; }
- Make directory and sub directory
@param string $directory Path of directory
@param int $mode Define chmod of path directory
@return bool Info if create the folder
- Make directory and sub directory