public function getUnique($alias)
    {
        if (!$this->exists($alias)) {
            return $alias;
        }

        $info = pathinfo($alias);
        $ext = isset($info['extension']) ? '.' . $info['extension'] : '';

        $counter = 0;

        do {
            $counter++;
            $modified = $info['filename'] . '-' . $counter . $ext;
        } while ($this->exists($modified));

        return $modified;
    }
public function getUnique($alias)
    {
        if (!$this->exists($alias)) {
            return $alias;
        }

        $info = pathinfo($alias);
        $ext = isset($info['extension']) ? '.' . $info['extension'] : '';

        $counter = 0;

        do {
            $counter++;
            $modified = $info['filename'] . '-' . $counter . $ext;
        } while ($this->exists($modified));

        return $modified;
    }
public function getUnique ( $ alias ) { if ( ! $ this -> exists ( $ alias ) ) { return $ alias ; } $ info = pathinfo ( $ alias ) ; $ ext = isset ( $ info [ 'extension' ] ) ? '.' . $ info [ 'extension' ] : '' ; $ counter = 0 ; do { $ counter ++ ; $ modified = $ info [ 'filename' ] . '-' . $ counter . $ ext ; } while ( $ this -> exists ( $ modified ) ) ; return $ modified ; }
Returns a unique alias using a base string
@param string $alias
@return string
Returns a unique alias using a base string