jeffersonsimaogoncalves/cakephp-analyzer

CakePHP分析插件

安装量: 1,205

依赖项: 0

建议者: 0

安全性: 0

星星: 2

关注者: 2

分支: 4

类型:cakephp-plugin

2.0.0 2020-11-09 12:32 UTC

This package is auto-updated.

Last update: 2024-09-09 21:08:36 UTC


README

此分析插件是一个跟踪和报告网站流量的插件。

安装

您可以使用composer将此插件安装到您的CakePHP应用程序中。

安装composer包的推荐方式是

composer require jeffersonsimaogoncalves/cakephp-analyzer

现在通过您的shell加载插件

$ bin/cake plugin load -b -r Analyzer

或者将以下代码放入您的config/bootstrap.php

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

运行迁移

$ bin/cake migrations migrate -p Analyzer

从现在起,所有请求都将被报告!

用法

忽略

您可以通过在config/bootstrap.php中放置以下代码来忽略注册请求

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

例如,此代码将忽略所有DebugKit请求

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

查找器

RequestsTable有以下查找器

Between

设置起始和结束日期

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

UniqueVisitors

尚未有效!

只查找唯一访问者

    $query->find('UniqueVisitors');

致谢

此作品基于CakeManager的代码