/**
* Creates a temp folder and returns its path.
* Please use TempFile::createFolder() class instead.
*
* @param string $prefix
* @param bool $fullPath Returns the full path on true and the relative to the current TempFolder on false.
*
* @return string Path with trailing slash
*/
public function createTempFolder($prefix = '', $fullPath = true)
{
$tmp = $this->jarves->getCacheDir();
do {
$path = $tmp . $prefix . dechex(time() / mt_rand(100, 500));
} while (is_dir($path));
mkdir($path);
if ('/' !== substr($path, -1)) {
$path .= '/';
}
return $fullPath ? $path : substr($path, strlen($tmp));
}