/** * Returns a unique absolut path of a file or folder. * * @param string $path * the path of a file or folder relative to the calling extension's * upload directory, must not be empty * * @return string the unique absolut path of a file or folder * * @throws InvalidArgumentException */ public function getUniqueFileOrFolderPath($path) { if (empty($path)) { throw new InvalidArgumentException('The first parameter $path must not be empty.', 1334439457); } if (!self::$fileNameProcessor) { self::$fileNameProcessor = t3lib_div::makeInstance('t3lib_basicFileFunctions'); } return self::$fileNameProcessor->getUniqueName(basename($path), $this->uploadFolderPath . t3lib_div::dirname($path)); }
/** * Returns a unique absolute path of a file or folder. * * @param string $path * the path of a file or folder relative to the calling extension's * upload directory, must not be empty * * @return string the unique absolute path of a file or folder * * @throws \InvalidArgumentException */ public function getUniqueFileOrFolderPath($path) { if (empty($path)) { throw new \InvalidArgumentException('The first parameter $path must not be empty.', 1334439457); } if (!self::$fileNameProcessor) { self::$fileNameProcessor = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Utility\\File\\BasicFileUtility'); } return self::$fileNameProcessor->getUniqueName(basename($path), $this->uploadFolderPath . GeneralUtility::dirname($path)); }