Skip to content

feat: PHAR single-file distribution#34

Merged
w3spi5 merged 8 commits intomainfrom
develop
Jan 5, 2026
Merged

feat: PHAR single-file distribution#34
w3spi5 merged 8 commits intomainfrom
develop

Conversation

@w3spi5
Copy link
Owner

@w3spi5 w3spi5 commented Jan 4, 2026

Summary

  • Add standalone PHAR build system for zero-install deployment
  • Single file contains all PHP, CSS, JS, and icons
  • Works in both web browser and CLI modes

Features

  • Web Mode: Upload bigdump.phar + config, access in browser
  • CLI Mode: php bigdump.phar dump.sql -o optimized.sql
  • Asset Inlining: No external dependencies, everything bundled
  • GitHub Actions: Automated PHAR build on tag push

Test plan

  • php tests/PharContextTest.php - 16 tests pass
  • php tests/PharBuildTest.php - 13 tests pass
  • php tests/PharEntryPointsTest.php - 16 tests pass
  • php tests/ViewAssetInliningTest.php - 13 tests pass
  • Manual test: php bigdump.phar --version works
  • Manual test: php bigdump.phar --help works

w3spi5 added 7 commits January 5, 2026 01:40
  SSE Reliability Fixes:
  - Fix PHP session locking blocking SSE connections
  - Add session_write_close() before rendering import page
  - Add SSE retry mechanism with exponential backoff (100ms-1600ms)
  - Fix output buffering order in SseService (ini_set before ob_end_clean)
  - Add ~8KB padding to force Apache/mod_fcgid buffer flush
  - Change return to exit after SSE error to prevent Response corruption

  Documentation:
  - Add "How It Works" section explaining staggered import behavior
  - Enhance Troubleshooting with Laragon-specific config paths
  - Add quick diagnostic command (php -S localhost:8000)
  - Document server configurations for SSE (Apache, nginx, Laragon)

  Git Cleanup:
  - Fix .gitignore to use **/CLAUDE.md pattern for all subdirectories
  - Remove CLAUDE.md files from git tracking
Add support for .bz2 and .sql.bz2 compressed SQL dump imports alongside
  existing .gz support, with full resume functionality via seek workaround.

  Key features:
  - BZ2 file detection with case-insensitive extension matching
  - bzopen/bzread/bzclose integration in FileHandler
  - ADR-001: Seek workaround using re-read strategy (O(n) resume time)
  - Conditional support based on PHP ext-bz2 availability
  - Purple "BZ2" badge in file listing
  - Frontend validation with custom error messages
  - Comprehensive test suite (24 tests across 4 files)

  Files modified:
  - src/Models/FileHandler.php - Core BZ2 support
  - src/Config/Config.php - Extension config + isBz2Supported()
  - templates/home.php - UI badge + data-bz2-supported
  - assets/js/fileupload.js - Conditional validation

  Test files created:
  - tests/FileHandlerBz2Test.php
  - tests/ConfigBz2Test.php
  - tests/FrontendBz2Test.php
  - tests/Bz2IntegrationTest.php
  - tests/fixtures/test_bz2_import.sql.bz2
Add standalone PHAR build for single-file deployment like Adminer.

  Features:
  - Dual-mode entry point (web browser + CLI optimizer)
  - Asset inlining (CSS, JS, SVG bundled in PHAR)
  - External config file (bigdump-config.php next to PHAR)
  - GitHub Actions workflow for automated releases

  New files:
  - build/build-phar.php - Build script
  - build/stubs/web-entry.php - Web mode bootstrap
  - build/stubs/cli-entry.php - CLI mode bootstrap
  - src/Core/PharContext.php - PHAR detection utilities
  - templates/layout_phar.php - Layout with inlined assets
  - .github/workflows/build-phar.yml - CI/CD pipeline

  Tests: 4 new test files, 58 tests total
  Output: bigdump.phar (~490 KB)
@w3spi5 w3spi5 merged commit c055daa into main Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments