rah/danpu
Danpu is a lightweight PHP library for dumping and restoring MySQL/MariaDB databases. Export schema and data to SQL files, optionally gzip-compressed, then import them again through a simple API or CLI, without relying on mysqldump binaries.
NULL vs 'NULL', binary/BLOB columns, charset and collation, AUTO_INCREMENT resets, views, triggers, routines, foreign-key ordering, and memory behavior on large tables. This package is a pure-PHP implementation of that, so the decision is roughly "adopt a small library" vs. "spend a sprint re-discovering edge cases." The library's narrow, single-responsibility surface makes the evaluation cheap.mysqldump, it unblocks backup features on restricted hosting/PaaS where exec() is disabled or the MySQL client binary isn't installed. This is a real segmentation decision: it expands where the product can be deployed, not just how.Adopt when:
mysqldump binary, no external agent.Look elsewhere when:
To executives: This is a small, MIT-licensed utility that lets us ship "export my data" and pre-deploy backup features without building a database dump engine from scratch. It removes a multi-week engineering risk for a narrow, well-understood problem and works in our hosting constraints where shelling out to MySQL tooling is not an option. The trade-off is that it is a point tool, not a backup strategy — it does not give us retention, encryption, or restore guarantees, so it complements rather than replaces managed database snapshots. Cost is near zero; the main obligation is that we own the code if it breaks.
To engineering: Pure-PHP MySQL dumper, streaming and memory-conscious, no shell dependency. Single responsibility: write a SQL dump. Last release 2018 and effectively unmaintained, so we vendor it, pin the version, wrap it behind our own DatabaseExporter interface, and add integration tests against a real MySQL instance covering BLOBs, charset, views, and large-table memory behavior. If it degrades on a future PHP upgrade, the interface lets us swap in mysqldump or an alternative without touching product code. Expected effort: a day to integrate and test, not a sprint.
How can I help you explore Laravel packages today?