library/Haste/Util/Files.php
public static function addUniqIdToFilename($strFileName, $strPrefix = null, $blnMoreEntropy = true)
    {
        $objFile = new \File($strFileName, true);

        $strDirectory = ltrim(str_replace(TL_ROOT, '', $objFile->dirname), '/');

        return ($strDirectory ? $strDirectory . '/' : '') . $objFile->filename . uniqid($strPrefix, $blnMoreEntropy) . ($objFile->extension ? '.'
                                                                                                                                              . $objFile->extension : '');
    }
public static function addUniqIdToFilename($strFileName, $strPrefix = null, $blnMoreEntropy = true)
    {
        $objFile = new \File($strFileName, true);

        $strDirectory = ltrim(str_replace(TL_ROOT, '', $objFile->dirname), '/');

        return ($strDirectory ? $strDirectory . '/' : '') . $objFile->filename . uniqid($strPrefix, $blnMoreEntropy) . ($objFile->extension ? '.'
                                                                                                                                              . $objFile->extension : '');
    }
public static function addUniqIdToFilename ( $ strFileName , $ strPrefix = null , $ blnMoreEntropy = true ) { $ objFile = new \ File ( $ strFileName , true ) ; $ strDirectory = ltrim ( str_replace ( TL_ROOT , '' , $ objFile -> dirname ) , '/' ) ; return ( $ strDirectory ? $ strDirectory . '/' : '' ) . $ objFile -> filename . uniqid ( $ strPrefix , $ blnMoreEntropy ) . ( $ objFile -> extension ? '.' . $ objFile -> extension : '' ) ; }
Add a unique identifier to a file name

@param      $strFileName    The file name, can be with or without path
@param null $strPrefix      Add a prefix to the unique identifier, with an empty prefix, the returned string will be 13 characters long.
@param bool $blnMoreEntropy If set to TRUE, will add additional entropy (using the combined linear congruential generator) at the end of the
return value, which increases the likelihood that the result will be unique.

@return string Filename with imestamp based unique identifier
Add a unique identifier to a file name