1. Go to this page and download the library: Download aedart/athenaeum-etags 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/ */
aedart / athenaeum-etags example snippets
use Aedart\ETags\Facades\Generator;
// Generate an ETag for strong comparison, of content
$etag = Generator::makeStrong($content);
echo (string) $etag; // "4720b076892bb2fb65e75af902273c73a2967e4a"
use Aedart\ETags\Preconditions\Evaluator;
use Aedart\ETags\Preconditions\Resources\GenericResource;
// Process If-Match, If-None-Match, If-Modified-Since... etc
// Depending on condition's pass/fail, the request can be aborted via
// an appropriate Http Exception, or proceed to your logic...
$resource = Evaluator::make($request)
->evaluate(new GenericResource(
data: $model,
etag: $model->getStrongEtag(),
lastModifiedDate: $model->updated_at
));
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.