private function getUniqFilename($path, $filename, $counter = 0)
    {
        if (($pos = mb_strrpos($filename, '.')) == FALSE)
        {
            $file = $filename;
            $extension = '';
        }
        else
        {
            $file = mb_substr($filename, 0, $pos);
            $extension = mb_substr($filename, $pos);
        }
        $postfix = $counter > 0 ? $this->slugSuffixSeparator . $counter : '';
        if (file_exists($path . '/' . $file . $postfix . $extension))
        {
            return $this->getUniqFilename($path, $filename, $counter + 1);
        }
        return $file . $postfix . $extension;
    }
private function getUniqFilename($path, $filename, $counter = 0)
    {
        if (($pos = mb_strrpos($filename, '.')) == FALSE)
        {
            $file = $filename;
            $extension = '';
        }
        else
        {
            $file = mb_substr($filename, 0, $pos);
            $extension = mb_substr($filename, $pos);
        }
        $postfix = $counter > 0 ? $this->slugSuffixSeparator . $counter : '';
        if (file_exists($path . '/' . $file . $postfix . $extension))
        {
            return $this->getUniqFilename($path, $filename, $counter + 1);
        }
        return $file . $postfix . $extension;
    }
private function getUniqFilename ( $ path , $ filename , $ counter = 0 ) { if ( ( $ pos = mb_strrpos ( $ filename , '.' ) ) == FALSE ) { $ file = $ filename ; $ extension = '' ; } else { $ file = mb_substr ( $ filename , 0 , $ pos ) ; $ extension = mb_substr ( $ filename , $ pos ) ; } $ postfix = $ counter > 0 ? $ this -> slugSuffixSeparator . $ counter : '' ; if ( file_exists ( $ path . '/' . $ file . $ postfix . $ extension ) ) { return $ this -> getUniqFilename ( $ path , $ filename , $ counter + 1 ) ; } return $ file . $ postfix . $ extension ; }
Get uniq name for upload

@param string $path
@param string $filename
@param number $counter
@return string
Get uniq name for upload