spaf/count-y 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

spaf/count-y

Composer 安装命令:

composer require spaf/count-y

包简介

Simple web-site visits counter lib

README 文档

README

Simple PHP Counter

Version: 2.0.2

To install

  1. Go to the folder of the project (git/code repo) /home/user/my-code
  2. Run commands in terminal in your code folder:
    composer require spaf/count-y;

Basic usage (file-based)

require __DIR__.'/vendor/autoload.php';

use spaf\county\Counter;
use spaf\county\storage\StorageFile;
use spaf\simputils\PHP;

PHP::init();

$c = new Counter(new StorageFile());
//  In case if the StorageFile is not specified, the value will be stored in memory (StorageMemory
//  class). So it will exist until end of the runtime/execution.
//$c = new Counter();

//  If you need events, first delegate/closure is an event function, the second - event condition. The first will work,
//  only if the second will return TRUE, or if condition delegate/closure is not specified.

//$c->add_event('My first test event', function ($value, $name) {
//	echo "EVENT of {$name} for value of {$value}\n";
//}, fn($v) => $v % 10 == 0 );

for ($i = 0; $i <= 105; $i++) {
	$c->visit();
	$c->visit();
	$c->visit();
}

echo "Test: {$c}";

That's it. The lib right now supports really minimal functionality.

统计信息

  • 总下载量: 9
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2021-07-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固