PHPackages                             hanwenbo/ttlock - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. hanwenbo/ttlock

ActiveLibrary

hanwenbo/ttlock
===============

debug

v1.0.3(7y ago)44.1k↓100%11[1 issues](https://github.com/hanwenbo/TTLock-php-sdk/issues)[1 PRs](https://github.com/hanwenbo/TTLock-php-sdk/pulls)Apache-2.0PHPPHP &gt;=7.2

Since Sep 16Pushed 2y ago4 watchersCompare

[ Source](https://github.com/hanwenbo/TTLock-php-sdk)[ Packagist](https://packagist.org/packages/hanwenbo/ttlock)[ RSS](/packages/hanwenbo-ttlock/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

TTLock-php-sdk
==============

[](#ttlock-php-sdk)

php sdk for TTLock

Install
-------

[](#install)

```
composer require hanwenbo/ttlock
```

使用
--

[](#使用)

```
use hanwenbo\ttlock;
...

$ttlock = new TTLock($clientId,$clientSecret);
// oauth2
$ttlock->oauth2->token($username,$password,$redirect_uri);
$ttlock->oauth2->refreshToken($refresh_token,$redirect_uri);

// date is  Current time (in millisecond)
$ttlock->user->register($username,$password,$date);
// Reset password
$ttlock->user->resetPassword($username,$password,$date);

$ttlock->user->list($startDate,$endDate,$pageNo,$pageSize,$date);
$ttlock->user->delete($username,$date);

// Lock
$ttlock->lock->initialize($lockData,$date,$lockAlias);
$ttlock->lock->list($pageNo,$pageSize,$date);
$ttlock->lock->listKey($lockId,$pageSize,$date);
$ttlock->lock->deleteAllKey($lockId,$date);
$ttlock->lock->listKeyboardPwd($lockId,$pageNo,$pageSize,$date);
$ttlock->lock->changeAdminKeyboardPwd($lockId,$password,$date);
$ttlock->lock->changeDeletePwd($lockId,$password,$date);
$ttlock->lock->rename($lockId,$lockAlias,$date);
$ttlock->lock->resetKey($lockId,$date);
$ttlock->lock->resetKeyboardPwd($lockId,$pwdInfo,$timestamp,$date);
$ttlock->lock->getKeyboardPwdVersion($lockId,$date);
$ttlock->lock->updateElectricQuantity($lockId,$electricQuantity,$date);
$ttlock->lock->transfer($receiverUsername,$lockIdList,$date);

// Passcode
$ttlock->passcode->get( int $lockId, int $keyboardPwdVersion, int $keyboardPwdType, int $startDate, int $endDate, int $date ) : array
$ttlock->passcode->delete( int $lockId, int $keyboardPwdId, int $deleteType, int $date ):array
$ttlock->passcode->change( int $lockId, int $keyboardPwdId, string $newKeyboardPwd, int $startDate, int $endDate, int $changeType, int $date ) : array
$ttlock->passcode->add( int $lockId, string $keyboardPwd, int $startDate, int $endDate, int $addType, int $date ) : array

// 其他接口本次开发没用上 后续有需要再完善

```

TODO
----

[](#todo)

- Result Model

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~21 days

Total

4

Last Release

2726d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ff4efaf379c6fae90645ba663b1ca2e6b2ac36d026dfdd473ebab4db5a476e05?d=identicon)[hanwenbo](/maintainers/hanwenbo)

---

Top Contributors

[![hanwenbo](https://avatars.githubusercontent.com/u/5869741?v=4)](https://github.com/hanwenbo "hanwenbo (14 commits)")

---

Tags

ttlockfashop

### Embed Badge

![Health badge](/badges/hanwenbo-ttlock/health.svg)

```
[![Health](https://phpackages.com/badges/hanwenbo-ttlock/health.svg)](https://phpackages.com/packages/hanwenbo-ttlock)
```

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k20](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
