- Notifications
You must be signed in to change notification settings - Fork7
Yii2 hit counter module for collecting and analyzing statistics on visitors.
License
coderius/yii2-hit-counter
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
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 #"auto">
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
The preferred way to install this extension is throughcomposer.
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 runcomposer update
Run migrations in root folder project:
php yii migrate/to m190926_110717_hit_counter__table --migrationPath=@coderius/hitCounter/migrations
Include module in app config file. Inadvanced template go tocommon/main.php
and set to config array next params:
$conf = [ ... ]; $conf['modules']['hitCounter'] = [ 'class' => 'coderius\hitCounter\Module', ]; $conf['bootstrap'][] = 'coderius\hitCounter\config\Bootstrap';
<?= \coderius\hitCounter\widgets\hitCounter\HitCounterWidget::widget([]); ?>
For tests neded test database and tables.Documentation about creating test db is attests/_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
About
Yii2 hit counter module for collecting and analyzing statistics on visitors.