PHP code example of activecollab / etag

1. Go to this page and download the library: Download activecollab/etag library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

activecollab / etag example snippets


/**
 * @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);
}