jeffersonsimaogoncalves/cakephp-analyzer

Analyzer plugin for CakePHP

Installs: 1 123

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 2

Forks: 4

Type:cakephp-plugin

2.0.0 2020-11-09 12:32 UTC

This package is auto-updated.

Last update: 2024-04-09 20:18:05 UTC


README

This Analyzer Plugin is a plugin that tracks and reports website traffic.

Installation

You can install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

composer require jeffersonsimaogoncalves/cakephp-analyzer

Now load the plugin via your shell:

$ bin/cake plugin load -b -r Analyzer

Or put the following in your config/bootstrap.php:

Plugin::load('Analyzer', ['bootstrap' => true]);

Run the migrations:

$ bin/cake migrations migrate -p Analyzer

From now on all requests will be reported!

Usage

Ignore

You can ignore to register request by putting the following code in your config/bootstrap.php:

Configure::write('Analyzer.Ignore.key', [
    'plugin' => 'DebugKit'
    'controller' => 'UsersController',
    'action' => 'index',
    'prefix' => 'admin',
]);

So, for example; this code will ignore all DebugKit requests:

Configure::write('Analyzer.Ignore.debug_kit', [
    'plugin' => 'DebugKit'
]);

Finders

The RequestsTable has the following finders:

Between

Set start- and end-date:

    $query->find('Between', [
        'start' => '-3 days',
        'end' => 'now',
    ]);

UniqueVisitors

Not valid yet!

Find only unique visitors:

    $query->find('UniqueVisitors');

Credits

This work is based on the code by CakeManager.