refactor: make repo Composer-compatible by moving php/ to root and ref/ to doc/reference_samples

- Move src/, tests/, bin/, generated/, proto/, composer.json, composer.lock, phpunit.xml from php/ to repo root
- Move ref/ to doc/reference_samples/ for better organization
- Remove vendor/ from git tracking (now properly gitignored)
- Update all test file paths (dirname adjustments and ref/ -> doc/reference_samples/)
- Update all documentation paths (AGENTS.md, doc/*.md)
- Remove php.bak/ directory
- All 252 tests pass
This commit is contained in:
Thorsten Bus 2026-03-30 13:26:29 +02:00
parent 8dbcc1bafc
commit 22ba4aff7d
3920 changed files with 100 additions and 178337 deletions

4
.gitignore vendored
View file

@ -1,4 +1,4 @@
.sisyphus .sisyphus
.php-cs-fixer.cache .php-cs-fixer.cache
.sisyphus .phpunit.result.cache
php/.phpunit.result.cache vendor/

View file

@ -57,10 +57,10 @@ PHP tools for parsing, modifying, and generating ProPresenter 7 files:
### CLI Tools ### CLI Tools
```bash ```bash
php php/bin/parse-song.php path/to/song.pro php bin/parse-song.php path/to/song.pro
php php/bin/parse-playlist.php path/to/playlist.proplaylist php bin/parse-playlist.php path/to/playlist.proplaylist
``` ```
### Key Source Files ### Key Source Files
All PHP source code is in `php/src/`. Generated protobuf classes are in `php/generated/`. Tests are in `php/tests/`. All PHP source code is in `src/`. Generated protobuf classes are in `generated/`. Tests are in `tests/`.

View file

@ -16,7 +16,7 @@ imagepng($image, $tmpPng);
$imageBytes = file_get_contents($tmpPng); $imageBytes = file_get_contents($tmpPng);
unlink($tmpPng); unlink($tmpPng);
$refDir = dirname(__DIR__, 2) . '/ref'; $refDir = dirname(__DIR__) . '/doc/reference_samples';
$song = ProFileGenerator::generate( $song = ProFileGenerator::generate(
'TestBild', 'TestBild',

View file

View file

@ -112,24 +112,24 @@ This project provides PHP tools to parse, modify, and generate ProPresenter 7 fi
| File | Purpose | | File | Purpose |
|------|---------| |------|---------|
| `php/src/Song.php` | Song wrapper (read/modify `.pro` files) | | `src/Song.php` | Song wrapper (read/modify `.pro` files) |
| `php/src/ProFileReader.php` | Read `.pro` files | | `src/ProFileReader.php` | Read `.pro` files |
| `php/src/ProFileWriter.php` | Write `.pro` files | | `src/ProFileWriter.php` | Write `.pro` files |
| `php/src/ProFileGenerator.php` | Generate `.pro` files from scratch | | `src/ProFileGenerator.php` | Generate `.pro` files from scratch |
| `php/src/PlaylistArchive.php` | Playlist wrapper (read/modify `.proplaylist` files) | | `src/PlaylistArchive.php` | Playlist wrapper (read/modify `.proplaylist` files) |
| `php/src/ProPlaylistReader.php` | Read `.proplaylist` files | | `src/ProPlaylistReader.php` | Read `.proplaylist` files |
| `php/src/ProPlaylistWriter.php` | Write `.proplaylist` files | | `src/ProPlaylistWriter.php` | Write `.proplaylist` files |
| `php/src/ProPlaylistGenerator.php` | Generate `.proplaylist` files from scratch | | `src/ProPlaylistGenerator.php` | Generate `.proplaylist` files from scratch |
| `php/src/PresentationBundle.php` | Bundle wrapper (read/write `.probundle` files) | | `src/PresentationBundle.php` | Bundle wrapper (read/write `.probundle` files) |
| `php/src/ProBundleReader.php` | Read `.probundle` files | | `src/ProBundleReader.php` | Read `.probundle` files |
| `php/src/ProBundleWriter.php` | Write `.probundle` files | | `src/ProBundleWriter.php` | Write `.probundle` files |
### CLI Tools ### CLI Tools
```bash ```bash
# Parse and display song structure # Parse and display song structure
php php/bin/parse-song.php path/to/song.pro php bin/parse-song.php path/to/song.pro
# Parse and display playlist structure # Parse and display playlist structure
php php/bin/parse-playlist.php path/to/playlist.proplaylist php bin/parse-playlist.php path/to/playlist.proplaylist
``` ```

View file

@ -223,13 +223,13 @@ try {
| File | Purpose | | File | Purpose |
|------|---------| |------|---------|
| `php/src/PresentationBundle.php` | Bundle wrapper (Song + media files) | | `src/PresentationBundle.php` | Bundle wrapper (Song + media files) |
| `php/src/ProBundleReader.php` | Reads `.probundle` files (with Zip64Fixer) | | `src/ProBundleReader.php` | Reads `.probundle` files (with Zip64Fixer) |
| `php/src/ProBundleWriter.php` | Writes `.probundle` files (standard ZIP) | | `src/ProBundleWriter.php` | Writes `.probundle` files (standard ZIP) |
| `php/src/ProFileGenerator.php` | Generates `.pro` files with media support | | `src/ProFileGenerator.php` | Generates `.pro` files with media support |
| `php/src/Zip64Fixer.php` | Fixes ProPresenter ZIP64 header bug | | `src/Zip64Fixer.php` | Fixes ProPresenter ZIP64 header bug |
| `ref/TestBild.probundle` | Generated reference file (PP7-verified) | | `doc/reference_samples/TestBild.probundle` | Generated reference file (PP7-verified) |
| `ref/RestBildExportFromPP.probundle` | PP7-exported reference file | | `doc/reference_samples/RestBildExportFromPP.probundle` | PP7-exported reference file |
--- ---

View file

@ -177,7 +177,7 @@ ProPlaylistGenerator::generateAndWrite(
## CLI Tool ## CLI Tool
```bash ```bash
php php/bin/parse-playlist.php path/to/playlist.proplaylist php bin/parse-playlist.php path/to/playlist.proplaylist
``` ```
Output includes: Output includes:
@ -212,14 +212,14 @@ See [Format Specification](../formats/pp_playlist_spec.md) Section 4 for details
| File | Purpose | | File | Purpose |
|------|---------| |------|---------|
| `php/src/PlaylistArchive.php` | Top-level playlist wrapper | | `src/PlaylistArchive.php` | Top-level playlist wrapper |
| `php/src/PlaylistEntry.php` | Entry wrapper (song/header/placeholder) | | `src/PlaylistEntry.php` | Entry wrapper (song/header/placeholder) |
| `php/src/PlaylistNode.php` | Playlist node wrapper | | `src/PlaylistNode.php` | Playlist node wrapper |
| `php/src/ProPlaylistReader.php` | Reads `.proplaylist` files | | `src/ProPlaylistReader.php` | Reads `.proplaylist` files |
| `php/src/ProPlaylistWriter.php` | Writes `.proplaylist` files | | `src/ProPlaylistWriter.php` | Writes `.proplaylist` files |
| `php/src/ProPlaylistGenerator.php` | Generates `.proplaylist` files | | `src/ProPlaylistGenerator.php` | Generates `.proplaylist` files |
| `php/src/Zip64Fixer.php` | Fixes ProPresenter ZIP64 header bug | | `src/Zip64Fixer.php` | Fixes ProPresenter ZIP64 header bug |
| `php/bin/parse-playlist.php` | CLI tool | | `bin/parse-playlist.php` | CLI tool |
--- ---

View file

@ -254,7 +254,7 @@ ProFileGenerator::generateAndWrite('output.pro', 'Song Name', $groups, $arrangem
## CLI Tool ## CLI Tool
```bash ```bash
php php/bin/parse-song.php path/to/song.pro php bin/parse-song.php path/to/song.pro
``` ```
Output includes: Output includes:
@ -282,16 +282,16 @@ try {
| File | Purpose | | File | Purpose |
|------|---------| |------|---------|
| `php/src/Song.php` | Top-level song wrapper | | `src/Song.php` | Top-level song wrapper |
| `php/src/Group.php` | Group (song part) wrapper | | `src/Group.php` | Group (song part) wrapper |
| `php/src/Slide.php` | Slide wrapper with text access | | `src/Slide.php` | Slide wrapper with text access |
| `php/src/TextElement.php` | Text element with RTF extraction | | `src/TextElement.php` | Text element with RTF extraction |
| `php/src/Arrangement.php` | Arrangement wrapper | | `src/Arrangement.php` | Arrangement wrapper |
| `php/src/RtfExtractor.php` | RTF to plain text converter | | `src/RtfExtractor.php` | RTF to plain text converter |
| `php/src/ProFileReader.php` | Reads `.pro` files | | `src/ProFileReader.php` | Reads `.pro` files |
| `php/src/ProFileWriter.php` | Writes `.pro` files | | `src/ProFileWriter.php` | Writes `.pro` files |
| `php/src/ProFileGenerator.php` | Generates `.pro` files | | `src/ProFileGenerator.php` | Generates `.pro` files |
| `php/bin/parse-song.php` | CLI tool | | `bin/parse-song.php` | CLI tool |
--- ---

View file

@ -16,7 +16,7 @@
- **IN**: Read+write existing content, parse all reference files - **IN**: Read+write existing content, parse all reference files
- **OUT**: Creating new slides/groups from scratch, Laravel integration, playlist formats - **OUT**: Creating new slides/groups from scratch, Laravel integration, playlist formats
- 2026-03-01 task-2 autoload decision: added `GPBMetadata\` => `generated/GPBMetadata/` to `php/composer.json` so generated `Rv\Data` classes can initialize descriptor metadata at runtime. - 2026-03-01 task-2 autoload decision: added `GPBMetadata\` => `generated/GPBMetadata/` to `composer.json` so generated `Rv\Data` classes can initialize descriptor metadata at runtime.
- 2026-03-01 task-2 ZIP64 repair strategy: patch archive headers in-memory only (no recompression), applying deterministic EOCD/ZIP64 size corrections before any `ZipArchive` access. - 2026-03-01 task-2 ZIP64 repair strategy: patch archive headers in-memory only (no recompression), applying deterministic EOCD/ZIP64 size corrections before any `ZipArchive` access.

View file

@ -57,7 +57,7 @@
- Use **nowdoc** (`<<<'RTF'`) for RTF test data with hex escapes (`\'xx`) - Use **nowdoc** (`<<<'RTF'`) for RTF test data with hex escapes (`\'xx`)
- Regular concatenated strings work for RTF without hex escapes (soft returns `\\` are fine) - Regular concatenated strings work for RTF without hex escapes (soft returns `\\` are fine)
- 2026-03-01 task-2 proto import resolution: copied full `Proto7.16.2/` tree (including `google/protobuf/*.proto`) into `php/proto/`; imports already resolve with `--proto_path=./php/proto`, no path rewrites required. - 2026-03-01 task-2 proto import resolution: copied full `Proto7.16.2/` tree (including `google/protobuf/*.proto`) into `proto/`; imports already resolve with `--proto_path=./proto`, no path rewrites required.
- 2026-03-01 task-2 version extraction: `application_info.platform_version` from Test.pro = macOS 14.8.3; `application_info.application_version` = major 20, build 335544354. - 2026-03-01 task-2 version extraction: `application_info.platform_version` from Test.pro = macOS 14.8.3; `application_info.application_version` = major 20, build 335544354.
- 2026-03-01 task-6 binary fidelity baseline: decode->encode byte round-trip currently yields `0/169` identical files (`168` non-empty from `all-songs` + `Test.pro`); first mismatches typically occur early (~byte offsets 700-3000), indicating systematic re-serialization differences rather than isolated corruption. - 2026-03-01 task-6 binary fidelity baseline: decode->encode byte round-trip currently yields `0/169` identical files (`168` non-empty from `all-songs` + `Test.pro`); first mismatches typically occur early (~byte offsets 700-3000), indicating systematic re-serialization differences rather than isolated corruption.
@ -102,7 +102,7 @@
- Slide wraps Cue (not PresentationSlide) because UUID is on the Cue - Slide wraps Cue (not PresentationSlide) because UUID is on the Cue
- Translation = second text element (index 1); no label detection needed - Translation = second text element (index 1); no label detection needed
- Lazy caching: textElements/allElements computed once per instance - Lazy caching: textElements/allElements computed once per instance
- Test.pro path from tests: dirname(__DIR__, 2) . '/ref/Test.pro' (2 levels up from php/tests/) - Test.pro path from tests: dirname(__DIR__) . '/doc/reference_samples/Test.pro' (1 level up from tests/)
## Task 7: Song + ProFileReader Integration (TDD) ## Task 7: Song + ProFileReader Integration (TDD)
@ -203,7 +203,7 @@
## Task 10: parse-playlist.php CLI Tool ## Task 10: parse-playlist.php CLI Tool
### Completed ### Completed
- ✅ Created `php/bin/parse-playlist.php` executable CLI tool - ✅ Created `bin/parse-playlist.php` executable CLI tool
- ✅ Follows `parse-song.php` structure exactly (shebang, autoloader, argc check, try/catch) - ✅ Follows `parse-song.php` structure exactly (shebang, autoloader, argc check, try/catch)
- ✅ Displays playlist metadata, entries with type-specific details, embedded file lists - ✅ Displays playlist metadata, entries with type-specific details, embedded file lists
- ✅ Plain text output (no colors/ANSI codes) - ✅ Plain text output (no colors/ANSI codes)

View file

Before

Width:  |  Height:  |  Size: 717 B

After

Width:  |  Height:  |  Size: 717 B

Some files were not shown because too many files have changed in this diff Show more