tsugi/lib
Composer 安装命令:
composer require tsugi/lib
包简介
The PHP Library to build interoperable learning tools
README 文档
README
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
All changes to the Tsugi PHP library must be committed and pushed to
tsugimasterbefore they are mirrored totsugi-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
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
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
From the tsugi repository root, run the mirror script:
qa/mirror-tsugi-php.sh
This script:
- Extracts the
lib/directory history - Reconstructs it as a standalone repository
- Force-updates
tsugi-phpmasterusing--force-with-lease
The result is an exact mirror of tsugi/lib.
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
- The history in
tsugi-phpis a projection of the monorepo history and may differ from earlier standalone commits. - Any commits made directly to
tsugi-phpmay be replaced during the next mirror operation. - All development discussion, issues, and pull requests belong in the main
tsugirepository.
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)
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
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
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
If you remember only one thing:
Commit and push to
tsugimasterfirst.
tsugi-phpis generated from that state.
tsugi/lib 适用场景与选型建议
tsugi/lib 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.95k 次下载、GitHub Stars 达 9, 最近一次更新时间为 2016 年 01 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 tsugi/lib 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tsugi/lib 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1.95k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 5
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2016-01-02