Download the PHP package lugano/yii2-count-user without Composer

On this page you can find all versions of the php package lugano/yii2-count-user. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package yii2-count-user

yii2-count-user

Module of count of users for YII2 with report by email

Installation

Extension may be installed by taking the following simple steps:

  1. add "lugano/yii2-count-user": "*" to the require section of your composer.json file.
  2. run composer install to install the specified extensions.
  3. execute yii migrate --migrationPath=vendor/lugano/yii2-count-user/migrations

Usage

Suppose, You have site with 4 pages. These pages has been displaying user using SiteController. This SiteController extends Controller from YII2, and has methods , called actionIndex, actionAdverbs, actionVerbs, actionDictionary.

Code below shows default YII2 controller for site.

SiteController extends Controller {

public $hosts;

public $views;

public function actionIndex(){

  self::countUser();
  return $this->render('index');

}

public function actionAdverbs(){

  self::countUser();
  return $this->render('adverbs');

}

public function actionVerbs(){

 self::countUser();
 return $this->render('verbs');

}

public function actionDictionary(){

  self::countUser();
  return $this->render('dictionary');

} }

In order to count users and views your site you must do several action:

1) Add use lugano\userCounter\controllers\DefaultController; in header file with your SiteController;

2) Add method in you SiteController(your default controller);

public function countUser()
{
        $settings = array(
                           'posmail' => '[email protected]',
                           'posname' => 'my-site.com',
                   'period' => '1...365'
                           );
        $temp = new DefaultController($settings);
        $report = $temp->counter();
        $this->views = $report['views'];
    $this->hosts = $report['hosts'];

}

3) Add two public properties $host and $views to your SiteController;

4) Call self::countUser() in each your method actionIndex, actionAdverbs, actionVerbs, actionDictionary

5) Add to your main.php file string like

Describing for variable $setting of class "DefaultController"

'posmail' - email will be receiving report from site; 'posname' - name for sender(your site); 'period' - period between reports from you site(not less than 1 and not more than 365 days);


All versions of yii2-count-user with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lugano/yii2-count-user contains the following files

Loading the files please wait ....