PHP code example of previewtechs / http-access-logger
1. Go to this page and download the library: Download previewtechs/http-access-logger 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/ */
previewtechs / http-access-logger example snippets
tup your Google Datastore Gateway
$gateway = new \GDS\Gateway\RESTv1('my-google-cloud-project-name');
$dataStore = new \GDS\Store('my-kind-name', $gateway);
//Initialize storage provider
$storage = new \Previewtechs\HTTP\AccessLogger\Providers\GoogleDataStore($dataStore);
/**
* Now start recording your HTTP access log by providign your storage provider and Psr/http-message ServerRequestInterface
* compatible $request object
*/
$log = new \Previewtechs\HTTP\AccessLogger\AccessLog($request, $storage);
$log->record();