coderius/yii2-hit-counter 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

coderius/yii2-hit-counter

最新稳定版本:1.0.2.2

Composer 安装命令:

composer require coderius/yii2-hit-counter

包简介

yii2 hit counter

README 文档

README

Software License Code Coverage Code Intelligence Status Code Quality CodeFactor Build Status

About extention

This extension allows you to organize the collection of data about website visitors. Data is stored in a database.

What visitor data is collected

Javascript and php are used to get information about visitors:

By Javascript:

  • Detect if client cookie enabled
  • Detect if java enabled
  • Detect if client has totuch device
  • Timezone offset
  • Type connection (like 4g etc.)
  • Current url
  • Referer url
  • Client screen width
  • Client screen height
  • Client color depth
  • Client browser language
  • Client history length
  • Client processor ram

By php:

  • Visitor ip address
  • Visitor user agent
  • Visitor referer url
  • Server name
  • Auth user id
  • Port
  • Cookies http
  • Os
  • Client info
  • Client device type (desctop etc.)
  • Device brand
  • Client device model (if detect)
  • Detect is bot
  • Host by ip
  • Is proxy or vpn
  • Date and time visit

Installation

The preferred way to install this extension is through composer.

First download module . Run the command in the terminal:

composer require "coderius/yii2-hit-counter"

or add in composer.json

"coderius/yii2-hit-counter": "^1.0"

and run composer update

Run migrations in root folder project:

php yii migrate/to m190926_110717_hit_counter__table --migrationPath=@coderius/hitCounter/migrations

Usage

Include module in app config file. In advanced template go to common/main.php and set to config array next params:

    $conf = [
        ...
    ];
    
    $conf['modules']['hitCounter'] = [
            'class' => 'coderius\hitCounter\Module',
        ];

    $conf['bootstrap'][] = 'coderius\hitCounter\config\Bootstrap';

In view file past hit counter widget:

<?= \coderius\hitCounter\widgets\hitCounter\HitCounterWidget::widget([]); ?>

Testing

For tests neded test database and tables. Documentation about creating test db is at tests/_app/README.md.

In order to run the tests you need to do the following:

  • Set alias in terminal to phpunit:
alias phpunit="/var/www/html/yii2-hit-counter/vendor/bin/phpunit"
  • Go to root folder module 'yii2-hit-counter' in terminal and run tests:
phpunit

统计信息

  • 总下载量: 3.85k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 2
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-10-10