public static function unlink($file)
    {
        // no errors should be thrown, return false instead.
        try {
            if (parent::unlink($file)) {
                return true;
            }
        } catch (\Exception $e) {}
        
        // try to force symlinks
        if (is_link($file)) {
            $sym = @readlink($file);
            if ($sym) {
                if (@unlink($file)) {
                    return true;
                }
            }
        }
        
        // try to use realpath
        if (realpath($file) && realpath($file) !== $file) {
            if (@unlink(realpath($file))) {
                return true;
            }
        }
        
        return false;
    }
public static function unlink($file)
    {
        // no errors should be thrown, return false instead.
        try {
            if (parent::unlink($file)) {
                return true;
            }
        } catch (\Exception $e) {}
        
        // try to force symlinks
        if (is_link($file)) {
            $sym = @readlink($file);
            if ($sym) {
                if (@unlink($file)) {
                    return true;
                }
            }
        }
        
        // try to use realpath
        if (realpath($file) && realpath($file) !== $file) {
            if (@unlink(realpath($file))) {
                return true;
            }
        }
        
        return false;
    }
public static function unlink ( $ file ) { // no errors should be thrown, return false instead. try { if ( parent :: unlink ( $ file ) ) { return true ; } } catch ( \ Exception $ e ) { } // try to force symlinks if ( is_link ( $ file ) ) { $ sym = @ readlink ( $ file ) ; if ( $ sym ) { if ( @ unlink ( $ file ) ) { return true ; } } } // try to use realpath if ( realpath ( $ file ) && realpath ( $ file ) !== $ file ) { if ( @ unlink ( realpath ( $ file ) ) ) { return true ; } } return false ; }
Unlink a file, which handles symlinks.

@param string $file The file path to the file to delete.
@return boolean Whether the file has been removed or not.
Unlink a file which handles symlinks .