Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Mysqldump Php Laravel Package

ifsnop/mysqldump-php

MySQLDump-PHP is a dependency-free, pure-PHP library that recreates mysqldump: back up table structures, data, views, triggers, stored routines and events, with compression, hooks, hex blobs, virtual columns and direct restore. No MySQL binary is required, and output matches the original mysqldump.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. ifsnop/mysqldump-php is a framework-agnostic, pure-PHP reimplementation of the mysqldump CLI. Its entire public surface is a constructor (PDO DSN + credentials + dumpSettings + pdoSettings), a start($filenameOrStream) call, and a handful of hooks (setTransformTableRowHook, setInfoHook, setTableWheres, setTableLimits). It has no Laravel service provider, no config file, no facade, and no framework coupling — which cuts both ways: it will not fight Laravel's container, but the integration is entirely ours to build. It is a point-in-time logical dump tool, not a backup framework; it does not schedule, rotate, verify, encrypt, or ship artifacts. Treat it as a driver, not a solution.

Technical risk (ranked).

  1. License — GPL-3.0. This is the gating risk, not a footnote. Internal use and SaaS operation are generally fine (GPL-3 has no network-distribution clause, unlike AGPL). But any scenario where we distribute the application to customers — on-prem installs, shipped appliances, a Docker image handed to a client, a marketplace plugin — pulls the copyleft obligation into the surrounding application. For a typical SaaS Laravel product this is likely acceptable; for a distributed product it is likely disqualifying. Legal sign-off must precede any code, and the decision should be documented so it is not re-litigated per squad.
  2. Maintenance signal is weak. The README still advertises Travis CI (a dead service), explicitly calls its test suite "an ugly hack," and documents support only up to PHP 7.3 / HHVM. The registry metadata shows ~1.3k stars but 0 dependents, and the stated last-release date (2026-08-25) is inconsistent with the surrounding evidence — verify against Packagist and the actual git history before trusting either number. Low dependents against high stars suggests shallow consumption: people install it, few build on it, fewer contribute.
  3. Correctness is the maintainer's claim, not our verified fact. The differentiating features are real and valuable — view dependency resolution via stand-in tables, hex-blob output, stored routines, events, virtual columns, insert-ignore, and dump-time row transformation. But the parity-with-mysqldump testing is self-described as fragile, and there is no published conformance report against MySQL 8.0/8.4 or MariaDB.
  4. In-process execution model. The dump runs inside a PHP request/worker: memory ceiling, max_execution_time, and connection lifetime all become backup-failure modes. This is a different operational shape than shelling out to a client binary.

Where it genuinely wins. Environments where the mysqldump binary is unavailable or unusable: managed MySQL (RDS/Aurora), containerized PHP-FPM images without the MySQL client, shared hosting, and CI runners. It also enables row-level PII transformation at dump time — a materially better story for producing GDPR-safe staging/dev datasets than post-processing a raw dump.

Key questions for the maintainer/vendor review.

  • What is the actual commit cadence and issue-triage latency over the last 12 months?
  • Does it support MySQL 8 caching_sha2_password auth, utf8mb4_0900_ai_ci, JSON, spatial types, and invisible/generated columns without corruption?
  • Which mysqldump compatibility gaps are known and documented?
  • Is there a stated policy on breaking changes, or a semver commitment?
  • Has anyone validated restore (not just dump) round-trips at scale?
  • Any plan to relicense or dual-license?

Integration Approach

Stack fit. Composer-installable, PSR-4 autoloaded (Ifsnop\Mysqldump\Mysqldump), PDO-based. Its PHP 5.3 floor means it runs anywhere our Laravel 9–11 / PHP 8.1–8.3 estate runs — but the floor also means the code has not been modernized, so we should pin an exact version and add it to our dependency-risk register rather than treat it as an evergreen library. It relies on pdo_mysql; confirm the extension is present in every runtime image, including queue workers and scheduled-task containers.

There is no Laravel package — we write one. Scope it as a thin internal adapter, roughly one sprint:

  • config/backup.php mapping dumpSettings to env-overridable keys.
  • A container singleton bound to a Dumper interface, so the implementation is swappable.
  • An Artisan command (db:dump) and a queued Job wrapper, so dumps never run on the request path.
  • A destination abstraction over Laravel's Storage disks (the library's stream-wrapper support makes S3/GCS targets feasible).
  • setTransformTableRowHook wired to a declarative, per-table PII redaction config — this is the highest-value internal feature and should be designed up front, not bolted on.

Migration path. If we currently shell out to mysqldump or use spatie/laravel-backup, do not rip it out. Introduce the Dumper interface, run the new adapter in parallel in staging for two to four weeks, and compare outputs by schema checksum, per-table row counts, and a restore drill into a scratch database. Promote to production only for non-critical databases first. Keep the legacy path behind a config flag for one release cycle.

Compatibility work to sequence early.

  • Verify privileges on each target: SELECT, plus SHOW VIEW, TRIGGER, and LOCK TABLES where relevant. Managed services often withhold LOCK TABLES; prefer single-transaction (already the default) and confirm MyISAM tables aren't in scope.
  • Validate charset handling end-to-end (utf8mb4 setting, not the default utf8 alias) with an emoji/4-byte round-trip test.
  • Test skip-definer and no-create-db behavior for cross-environment restores.
  • Confirm behavior on Aurora, PlanetScale-style restrictive tiers, and MariaDB if any of those are in the estate.

Sequencing. (1) Legal ruling on GPL-3.0 → (2) maintainer-health and feature-gap spike against a production-like snapshot → (3) adapter + config + tests → (4) staging parity and restore drill → (5) PII hook rollout to staging data → (6) production pilot on one non-critical service → (7) general availability with documented runbook.

Operational Impact

Maintenance. Single-maintainer risk with a GPL obligation attached. Assume we may need to vendor a pinned fork; budget a small ongoing owner (roughly 10–15% of one engineer) for version bumps, MySQL-version compatibility checks, and security review. Because the license is GPL-3.0, internal patches carry no distribution trigger — but if we ever distribute the application, our patch set becomes distributable source. Codify that boundary now.

Support. Community-only: GitHub issues, a wiki, no vendor SLA, no CVE process we can subscribe to. Escalation = we fix it. For a backup path — a tier-0 recoverability control — that is a real exposure and should be reflected in the risk register with a named fallback (the mysqldump binary or a managed-snapshot service) that we test quarterly.

Scaling. Dumps are CPU- and memory-bound in PHP, single-threaded, with no parallelism across tables. Large tables will hit memory_limit and max_execution_time unless we tune them, stream to disk/object storage, or shard the job per table using include-tables. Compression reduces storage and network but adds CPU. setTableLimits and setTableWheres are the pragmatic levers for dev/staging datasets; production backups should not use them. Note the defaults enable lock-tables and single-transaction — confirm which path actually executes on your engine mix before promising zero-lock behavior.

Failure modes to instrument.

  • Partial/truncated dump left on disk with no error surfaced → write to .tmp and atomically rename; emit a size-delta alert.
  • Disk or stream exhaustion mid-dump.
  • Silent privilege failures on views/triggers producing an incomplete but syntactically valid dump.
  • Long-running dumps holding a transaction open and inflating InnoDB history list / replica lag.
  • Restore failures from DEFINER clauses or charset mismatches — only a restore drill catches these.
  • Clock/timezone skew from skip-tz-utc defaults.
  • No built-in checksum or verification: we must add checksum emission and a scheduled restore test, or the backup is unproven.

Ramp-up. Low for engineers — the documented API is small and the README covers most settings. A mid-level PHP developer is productive in a day, but the operational competence (privileges, restore validation, PII hook design) is where the effort sits. Plan for a written runbook, a restore drill as an acceptance gate, and a half-day knowledge transfer to whoever carries the on-call pager.

Verdict. Adopt conditionally: strong technical fit for binary-free dumping and PII-safe dataset generation, but only after a legal ruling on GPL-3.0 and a maintainer-health spike. Do not adopt it as the sole production backup mechanism without a tested fallback.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
ably/pubsub-server
mstfkhazaal/defender
mfonte/base62x
karnoweb/metapilot
tobya/bcsapiwrapper
swalker2/cpanel
vish4395/laravel-translation-manager
morningtrain/economic
teksite/systeminfo-laravel
atomcms/voting
run6/weather
siokas/laravelembeddirectives
adamlien/pkuuids
gilsonsouza/lara-doc-generator
manelgavalda/enrollment_mobile
unabomber/timezone
delatbabel/contacts
astritzeqiri/g-recaptcha
kevinongko/laravel-genode
developeruz/laravel-analytics