protected function _addExt($file, $ext)
    {
        if (substr($file, strlen($ext) * -1) !== $ext) {
            $file .= $ext;
        }

        return $file;
    }
protected function _addExt($file, $ext)
    {
        if (substr($file, strlen($ext) * -1) !== $ext) {
            $file .= $ext;
        }

        return $file;
    }
protected function _addExt ( $ file , $ ext ) { if ( substr ( $ file , strlen ( $ ext ) * - 1 ) !== $ ext ) { $ file .= $ ext ; } return $ file ; }
Adds an extension if the file doesn't already end with it.

@param string $file Filename
@param string $ext Extension with .
@return string
Adds an extension if the file doesn t already end with it .