fahriztx/zksoapphp

一个用于通过SOAP协议管理指纹机数据的PHP库

v1.0.2 2023-03-17 17:32 UTC

This package is auto-updated.

Last update: 2024-09-17 21:05:51 UTC


README

一个用于通过SOAP协议管理指纹机数据的PHP库

功能

  • 通过日期范围获取考勤记录
  • 获取用户信息

需求

  • PHP版本 7.2 或更高
  • 指纹机支持ZK Web服务

易于安装

使用composer安装

要使用 Composer 安装,只需要求此包的最新版本。

composer require fahriztx/zksoapphp

确保已加载Composer的autoload文件。

// somewhere early in your project's loading, require the Composer autoloader
// see: https://getcomposer.org.cn/doc/00-intro.md
require 'vendor/autoload.php';

快速开始

只需传递您的IP、端口和Comkey

  • 获取考勤
// reference the ZK Soap PHP namespace
use Fahriztx\Zksoapphp\Fingerprint;

// initial
$machine = Fingerprint::connect('192.168.1.175', '80', '123456');

// get machine status
echo "Machine Status : ".$machine->getStatus(); // connect | disconnect

// get all log data
print_r($machine->getAttendance()); // return Array of Attendance Log

// get all log data with date
print_r($machine->getAttendance('all', '2022-05-01')); // return Array of Attendance Log

// get all log data with date range
print_r($machine->getAttendance('all', '2022-05-01', '2022-05-10')); // return Array of Attendance Log

// get specific pin log data
print_r($machine->getAttendance(1)); // return Array of Attendance Log
// OR Array
print_r($machine->getAttendance([1, 2])); // return Array of Attendance Log
  • 获取用户信息
// reference the ZK Soap PHP namespace
use Fahriztx\Zksoapphp\Fingerprint;

// initial
$machine = Fingerprint::connect('192.168.1.175', '80', '123456');

// get machine status
echo "Machine Status : ".$machine->getStatus(); // connect | disconnect

// get all user data
print_r($machine->getUserInfo()); // return Array of User Info Data

// get specific pin user data
print_r($machine->getUserInfo(1)); // return Array of User Info Data
// OR Array
print_r($machine->getUserInfo([1, 2])); // return Array of User Info Data

更新日志

  • 添加对PHP >= 8.0的支持
  • 修复了静态方法Fahriztx\Zksoapphp\Fingerprint::connect()无法静态调用的错误