2017 © Pedro Peláez
 

yii2-extension yii2-ranking

The ranks extension for the Yii framework

image

xutl/yii2-ranking

The ranks extension for the Yii framework

  • Thursday, April 6, 2017
  • by xutl
  • Repository
  • 0 Watchers
  • 1 Stars
  • 1,313 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

yii2-ranks

redis ranks, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist xutl/yii2-ranking

or add, (*4)

"xutl/yii2-ranking": "~1.0.0"

to the require section of your composer.json file., (*5)

配置

To use this extension, you have to configure the Connection class in your application configuration:, (*6)

return [
    //....
    'components' => [
        'ranking' => [
           'class' => 'xutl\ranking\Client',
           'redis' => [
                'scheme' => 'tcp',
                'host' => '127.0.0.1',
                'port' => 6379,
                //'password' => '1984111a',
                'db' => 0
           ],
        ],
    ]
];

使用

/** @var \xutl\ranking\Ranking $ranking */
$ranking = Yii::$app->ranking->getRankingRef('download');

$ranking->addScores(1, 2);
$ranking->addScores(2, 2);
$ranking->addScores(2, 2);
$ranking->addScores(1, 2);
$ranking->addScores(3, 2);
$ranking->addScores(3, 2);
$ranking->addScores(1, 2);
$ranking->addScores(5, 2);
$ranking->addScores(6, 2);
$ranking->addScores(7, 2);
$ranking->addScores(9, 2);
$ranking->addScores(1, 2);
$ranking->addScores(1, 2);
$rankings = $ranking->getCurrentMonthTop10(date('Ymd'), 0, 9);
print_r($rankings);
exit;

The Versions

06/04 2017

dev-master

9999999-dev

The ranks extension for the Yii framework

  Sources   Download

BSD-3-Clause

The Requires

 

by Avatar xutl

yii2 yii ranks

06/04 2017

2.0.0

2.0.0.0

The ranks extension for the Yii framework

  Sources   Download

BSD-3-Clause

The Requires

 

by Avatar xutl

yii2 yii ranks

05/04 2017

1.0.0

1.0.0.0

The ranks extension for the Yii framework

  Sources   Download

BSD-3-Clause

The Requires

 

by Avatar xutl

yii2 yii ranks