PHPackages                             tsugi/lib - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tsugi/lib

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tsugi/lib
=========

The PHP Library to build interoperable learning tools

26.1.5(3mo ago)81.9k26[11 issues](https://github.com/tsugiproject/tsugi-php/issues)2Apache-2.0PHPPHP &gt;=8.4.0CI failing

Since Jan 2Pushed 3mo ago3 watchersCompare

[ Source](https://github.com/tsugiproject/tsugi-php)[ Packagist](https://packagist.org/packages/tsugi/lib)[ Docs](http://www.tsugi.org/)[ RSS](/packages/tsugi-lib/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (6)Versions (31)Used By (2)

Making Changes to the Tsugi PHP Library
---------------------------------------

[](#making-changes-to-the-tsugi-php-library)

The Tsugi PHP library is developed **only** in the main `tsugi` monorepo. The standalone `tsugi-php` repository is a **read-only mirror** used for Packagist distribution.

### Canonical Rule

[](#canonical-rule)

> **All changes to the Tsugi PHP library must be committed and pushed to
> `tsugi` `master` before they are mirrored to `tsugi-php`.**

Changes flow one way:

```
tsugi (master, lib/) → tsugi-php (master) → Packagist

```

Direct commits or pull requests to `tsugi-php` are not accepted and may be overwritten.

---

Step-by-Step Workflow
---------------------

[](#step-by-step-workflow)

### 1. Work in the main Tsugi repository

[](#1-work-in-the-main-tsugi-repository)

Clone and work in the canonical repository:

```
git clone https://github.com/tsugiproject/tsugi.git
cd tsugi
```

Make all code changes **only** under the `lib/` directory.

---

### 2. Commit and push to `tsugi` master

[](#2-commit-and-push-to-tsugi-master)

Before mirroring, changes **must** be committed and pushed to the canonical branch:

```
git status
git add lib/
git commit -m "Describe the change to the Tsugi PHP library"
git push origin master
```

Only committed changes are eligible to be mirrored.

---

### 3. Mirror `lib/` to the `tsugi-php` repository

[](#3-mirror-lib-to-the-tsugi-php-repository)

From the **tsugi repository root**, run the mirror script:

```
qa/mirror-tsugi-php.sh
```

This script:

1. Extracts the `lib/` directory history
2. Reconstructs it as a standalone repository
3. Force-updates `tsugi-php` `master` using `--force-with-lease`

The result is an exact mirror of `tsugi/lib`.

---

### 4. Verify (optional)

[](#4-verify-optional)

After mirroring, you may verify that the change appears in the standalone repo:

```
git ls-remote https://github.com/tsugiproject/tsugi-php.git
```

or by browsing the repository on GitHub.

---

Important Notes
---------------

[](#important-notes)

- The history in `tsugi-php` is a **projection** of the monorepo history and may differ from earlier standalone commits.
- Any commits made directly to `tsugi-php` may be replaced during the next mirror operation.
- All development discussion, issues, and pull requests belong in the main `tsugi` repository.

---

---

Running Unit Tests
------------------

[](#running-unit-tests)

The Tsugi PHP library includes a comprehensive test suite with 70+ test files covering Core, Util, UI, Crypt, and other components.

### From the `/tsugi/lib` directory (monorepo)

[](#from-the-tsugilib-directory-monorepo)

When working in the main `tsugi` repository:

```
cd tsugi/lib
composer install  # Install dependencies if needed
composer test     # Run all tests
```

Or run PHPUnit directly:

```
cd tsugi/lib
./vendor/bin/phpunit --configuration phpunit.xml.dist
```

### From the `tsugi-php` mirror repository root

[](#from-the-tsugi-php-mirror-repository-root)

When working in the standalone `tsugi-php` repository:

```
cd tsugi-php
composer install  # Install dependencies if needed
composer test     # Run all tests
```

Or run PHPUnit directly:

```
cd tsugi-php
./vendor/bin/phpunit --configuration phpunit.xml.dist
```

### Running specific tests

[](#running-specific-tests)

To run a specific test file or directory:

```
# From lib/ or tsugi-php root
./vendor/bin/phpunit tests/Core/LaunchTest.php
./vendor/bin/phpunit tests/Util/
```

---

Summary
-------

[](#summary)

**If you remember only one thing:**

> **Commit and push to `tsugi` `master` first.
> `tsugi-php` is generated from that state.**

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance61

Regular maintenance activity

Popularity26

Limited adoption so far

Community30

Small or concentrated contributor base

Maturity91

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 97.2% 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 ~167 days

Recently: every ~9 days

Total

23

Last Release

113d ago

Major Versions

0.7.0 → 21.1.02021-01-14

21.3.1 → 22.3.12022-03-01

22.3.1 → 24.5.12024-04-01

24.5.1 → 25.5.12025-02-01

25.12.3 → 26.1.22026-01-07

PHP version history (6 changes)0.0.1-alphaPHP &gt;=5.5.0

21.1.0PHP &gt;=7.0.0

21.1.1PHP &gt;=7.2.0

22.3.1PHP &gt;=7.2.0 &lt;8.1.0

24.5.1PHP &gt;=8.2.0

25.9.1PHP &gt;=8.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/71fd4e66834ecf7a5dbecb209362ccaddadf5674445c38e828578c5bf09d0f24?d=identicon)[drchuck](/maintainers/drchuck)

---

Top Contributors

[![csev](https://avatars.githubusercontent.com/u/1197222?v=4)](https://github.com/csev "csev (3091 commits)")[![davidpbauer](https://avatars.githubusercontent.com/u/4632527?v=4)](https://github.com/davidpbauer "davidpbauer (22 commits)")[![aqeel-tkxel](https://avatars.githubusercontent.com/u/22531359?v=4)](https://github.com/aqeel-tkxel "aqeel-tkxel (7 commits)")[![i-do-dev](https://avatars.githubusercontent.com/u/63515864?v=4)](https://github.com/i-do-dev "i-do-dev (5 commits)")[![TurRil](https://avatars.githubusercontent.com/u/380635?v=4)](https://github.com/TurRil "TurRil (5 commits)")[![ottenhoff](https://avatars.githubusercontent.com/u/810505?v=4)](https://github.com/ottenhoff "ottenhoff (5 commits)")[![jonespm](https://avatars.githubusercontent.com/u/27447?v=4)](https://github.com/jonespm "jonespm (4 commits)")[![ziaulrehman40](https://avatars.githubusercontent.com/u/22441482?v=4)](https://github.com/ziaulrehman40 "ziaulrehman40 (3 commits)")[![andrewniekamp](https://avatars.githubusercontent.com/u/6700647?v=4)](https://github.com/andrewniekamp "andrewniekamp (3 commits)")[![azeckoski](https://avatars.githubusercontent.com/u/86429?v=4)](https://github.com/azeckoski "azeckoski (3 commits)")[![Nguyen26052004](https://avatars.githubusercontent.com/u/44332663?v=4)](https://github.com/Nguyen26052004 "Nguyen26052004 (3 commits)")[![peppersc](https://avatars.githubusercontent.com/u/24394905?v=4)](https://github.com/peppersc "peppersc (3 commits)")[![ThomasBrierley](https://avatars.githubusercontent.com/u/12444321?v=4)](https://github.com/ThomasBrierley "ThomasBrierley (3 commits)")[![favour-olumese](https://avatars.githubusercontent.com/u/70489864?v=4)](https://github.com/favour-olumese "favour-olumese (2 commits)")[![jonhartm](https://avatars.githubusercontent.com/u/35118448?v=4)](https://github.com/jonhartm "jonhartm (2 commits)")[![maurercw](https://avatars.githubusercontent.com/u/8582887?v=4)](https://github.com/maurercw "maurercw (2 commits)")[![btopro](https://avatars.githubusercontent.com/u/329735?v=4)](https://github.com/btopro "btopro (2 commits)")[![corne-oosthuizen](https://avatars.githubusercontent.com/u/17254391?v=4)](https://github.com/corne-oosthuizen "corne-oosthuizen (2 commits)")[![cleblond](https://avatars.githubusercontent.com/u/4019904?v=4)](https://github.com/cleblond "cleblond (2 commits)")[![mlhess](https://avatars.githubusercontent.com/u/1014671?v=4)](https://github.com/mlhess "mlhess (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tsugi-lib/health.svg)

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

###  Alternatives

[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[getdkan/dkan

DKAN Open Data Catalog

385135.4k2](/packages/getdkan-dkan)[verbb/formie

The most user-friendly forms plugin for Craft.

101372.9k40](/packages/verbb-formie)[phpseclib/phpseclib2_compat

phpseclib 2.0 polyfill built with phpseclib 3.0

131.9M13](/packages/phpseclib-phpseclib2-compat)[shopware/app-php-sdk

Shopware App SDK for PHP

1577.8k1](/packages/shopware-app-php-sdk)

PHPackages © 2026

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