protected function makeDirectory($path, $baseDir = null)
	{
		if (is_dir($path) === true) {
			return;
		}

		if ($this->chmod === null) {
			$chmod = 0777;
		} else {
			$chmod = $this->chmod;
		}
		mkdir($path, $chmod, true);

		// enforce the correct mode for all directories created
		if (strpos(PHP_OS, 'WIN') !== 0 && $baseDir !== null) {
			$path = strtr(str_replace($baseDir, '', $path), '\\', '/');
			$folders = explode('/', trim($path, '/'));
			foreach ($folders as $folder) {
				$baseDir .= $folder . DIRECTORY_SEPARATOR;
				chmod($baseDir, $chmod);
			}
		}
	}