/** * Create temporary folder in Joomla! template directory. * * @param string $mask name of new folder if folder already exist function given number on name begin * @return string template folder absolute path, if unable folder create function return false */ public static function createTemporaryFolder($mask) { if ($tmpFolder = JoomDOCFileSystem::getJoomlaTemporaryFolder()) { $r = ''; do { $absolutePath = JPath::clean($tmpFolder . DIRECTORY_SEPARATOR . $r++ . $mask); } while (JFolder::exists($absolutePath)); if (!JFolder::create($absolutePath)) { JError::raiseWarning(21, JText::sprintf('JOOMDOC_UNABLE_CREATE_TEMPLATE_FOLDER', $absolutePath)); } else { return $absolutePath; } } return false; }