rk/php-sword
Composer 安装命令:
composer require rk/php-sword
包简介
A PHP library for reading SWORD project Bible modules. Inspired by PySword.
README 文档
README
PHP Sword is a library for interacting with SWORD Project Bible Modules, intended for other uses like converting to other formats or working with the raw data. Inspired by PySword.
Features
- Reads Bible modules.
- Supports ztext, ztext4, rawtext, rawtext4 formats.
- Supports compressed modules, in zip format.
- Supports PHP 8.4+
- Sapphire II Stream Cipher
Development Structure
- _doc - internal planning documents, ignored in .git
- _doc/wiki - internal documentation of the structure
- _doc/PySword - a copy of PySword for translation from
- src/ - PSR-4 compatible package root
- tests/ - where our tests go
AI agents SHALL MAINTAIN the _doc/wiki as a current description of architecture, decisions, and memories.
Goals
- A feature-complete translation of PySword in PHP.
- It SHOULD be idiomatic PHP.
- It MUST use minimal or preferably NO 3rd party packages except during development.
- It MUST adhere to PSR-4 and PER3.0 standards.
- It MUST adhere to SemVer.
- It SHOULD document/DocBlock anything that requires additional context.
- It MUST exclude non-essential files using .gitattributes.
- It MUST maintain a changelog for each release, and it should state both the WHAT and WHY.
Getting Started
composer install composer download-bibles # fetches KJV, ASV, and other fixture modules composer test # 45 tests; 3 skipped when FTP fixtures unavailable composer lint && composer analyse
Set PHP_SWORD_AUTO_DOWNLOAD=1 to auto-download missing bible fixtures when running tests.
ChiPinyin test gap: testLoadChipinyinZip is skipped when chipinyin.zip is missing. The
CrossWire/Xiphos FTP mirror for that module is down and no alternative download URL was found, so
this integration test cannot be repaired until a substitute fixture source is available.
Roadmap
- Phase 1
- Package development environment configuration, like test framework, linter, formatter, etc.
- Translate all test cases from PySword as a reference implementation.
- Phase 2
- Translate or implement all features in PySword.
- Test cases UNCHANGED (fixture text captured from downloaded modules where PySword assertions differ).
- Phase 3
- Complete test case coverage if less than 80%.
- Phase 4
- TBD
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-13