New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

activecollab/etag

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

activecollab/etag

Tag objects and collections using etag

Source
Packagist
Version
2.0.0
Version published
Total downloads
18K
Maintainers
1
Created
Source

Etag Interface

Build Status

Tag objects and collections using etag, and validate cached values. This package contains only the interface, so actual implementation needs to be implemented in libraries that use it.

ActiveCollab\Etag\EtagInterface Interface says it all:

/**
 * @package ActiveCollab\Etag
 */
interface EtagInterface
{
    /**
     * Return true if this state of this object can be tagged and cached on client side.
     *
     * @return boolean
     */
    public function canBeEtagged();

    /**
     * Return etag.
     *
     * $visitor_identifier is a way that we identify a particular visitor (different people can use the same browsers
     * under the same profile, and share the cache, so we need to address that).
     *
     * @param  string  $visitor_identifier
     * @param  boolean $use_cache
     * @return string
     */
    public function getEtag($visitor_identifier, $use_cache = true);

    /**
     * Check if provided etag value matches the current object state.
     *
     * $visitor_identifier is a way that we identify a particular visitor (different people can use the same browsers
     * under the same profile, and share the cache, so we need to address that).
     *
     * @param  string  $value
     * @param  string  $visitor_identifier
     * @param  boolean $use_cache
     * @return boolean
     */
    public function verifyEtag($value, $visitor_identifier, $use_cache = true);
}

Keywords

Etag

FAQs

Package last updated on 09 Mar 2024

Related posts