access-watch / access-watch
A PHP library to log and analyse HTTP traffic using the Access Watch cloud service.
Requires
- php: >=5.3.9
- bouncer/bouncer: ~2.2.0
README
A PHP library to log and analyse HTTP requests using the Access Watch cloud service.
Based on the more generic Bouncer library.
Installation
Install the latest version with
$ composer require access-watch/access-watch
Basic Usage
Start Access Watch as soon as possible in your codebase.
You will need an API key for it.
To get an API key, send us an email at api@access.watch and we will come back to you.
<?php use \AccessWatch\AccessWatch; $accessWatch = new AccessWatch(array( 'apiKey' => 'ACCESS_WATCH_API_KEY_HERE', )); $accessWatch->start();
Cache
Out of the basic logging scenario, to properly operate, a cache backend needs to be defined. If no cache is set, the library will try to use APC/APCu.
Check the documentation of the Bouncer library for more information about caching.
<?php use \AccessWatch\AccessWatch; $memcache = new Memcache(); $memcache->addServer('localhost'); $accessWatch = new AccessWatch(array( 'apiKey' => 'ACCESS_WATCH_API_KEY_HERE', 'cache' => new \Bouncer\Cache\Memcache($memcache) )); $accessWatch->start();
Author
François Hodierne - francois@access.watch - http://access.watch/
License
The Access Watch PHP library is licensed under the MIT License - see the LICENSE
file for details