simonmesmith/yii2-anonymoususer

This package is abandoned and no longer maintained. No replacement package was suggested.

A Yii2 extension for tracking anonymous users.

Installs: 77

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 1

Open Issues: 0

Type:yii2-extension

pkg:composer/simonmesmith/yii2-anonymoususer

1.0.1 2014-07-17 01:57 UTC

This package is not auto-updated.

Last update: 2021-06-21 10:09:46 UTC


README

A Yii2 extension for tracking anonymous users.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist simonmesmith/yii2-googleadsense "*"

or add

"simonmesmith/yii2-googleadsense": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed :

  1. Run /data/anonymoususer.sql to set up the required table. Note that it currently creates the table with a tbl_ prefix. Also note that I've yet to experiment with Yii2 migrations for setting up database objects, hence why this just uses a .sql file.
  2. Add the following to your main.php configuration file:
    'components' => [
		...
	    'anonymousUser' => [
	        'class' => 'simonmesmith\anonymoususer\AnonymousUserComponent',
	    ],
		...
  1. Use the component when you need to track an anonymous user as follows:
    Yii::$app->anonymousUser->id