Download the PHP package mr5/counter-rank without Composer

On this page you can find all versions of the php package mr5/counter-rank. 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 counter-rank

Build Status License

简介

Counter-Rank 是一个使用 PHP 语言编写的、基于 Redis 的排名与计数类库,主要是对 Redis 的 zset 操作进行了封装。并提供了一个 JSClientHandler 类,可以快速地生成 JsonP 接口用于满足一些静态页面的计数需求以及将数字渲染到页面。

本类库的源代码中有详细的注释,你可以使用类 PHPDoc 的工具生成 classes reference manual 。

安装

composer.json 中添加:

然后安装

注意事项

打开 phpunit.xml 文件,找到以下片段:

如你要运行本类库的单元测试,请注意其中 REDIS_NAMESPACE 定义的命名空间,以防误删你的 Redis 数据。如有必要,可以修改该值。

基础使用

JSClientHandler 的使用

JSClientHandler 是一个用于生成 JS 客户端的工具类。 它可以实现以下功能:

以下是一个自定义控制器参考,请根据自己使用的框架以及需求进行修改,另外还建议阅读 JSClientHandler.php 的源代码,内含详细的 PHP Doc:

自定义 token 验证规则

token 默认验证方式是判断用户递交的 token 是否等于约定的 token , 你可以通过传递一个闭包给 setTokenVerifier 方法来自定义这个验证规则。 下面是自定义 tokenVerifier 的例子:

持久化计数数据

CounterRank 类提供了一个迭代器,通过 getIterator() 方法来获取迭代器,并迭代出计数器中所有的数据

下面是一个同步到数据库的例子:


All versions of counter-rank with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
ext-redis Version *
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 mr5/counter-rank contains the following files

Loading the files please wait ....