Skip to content

Core Concepts

ProcessReactExportProfile separates discovery, planning, execution, and verification into dedicated services under Totoglu\ProcessReactExportProfile\Engine\* coordinated by ExportProfileRuntime.

flowchart TD
    A["PreflightAuditor + ContributorCollector"] --> B["Build ExportPlan (or load PresetStore recipe)"]
    B --> C["ChunkedExportRunner (6 resumable steps or ExportProfileQueue)"]
    C --> D["ConfigCompiler + SecretScanner scrub config.php, modules & rows"]
    D --> E["DatabaseExporter + FileArchiver + FinishScriptGenerator"]
    E --> F["ProfileVerifier scans output dir & ZIP for leaked secrets"]
    F --> G["Save verified profile in ProfileRepository + audit log"]

PreflightAuditor inspects your active database tables, site/config.php diffs against wire/config.php, installed modules, and orphan asset directories (cached for 60s via getCachedAudit()). Simultaneously, ContributorCollector gathers ContributorRuleSet policies from installed modules and ProcessReactExportProfile::collectContributors.

Every export is driven by an immutable ExportPlan DTO specifying profile slug, title, summary, output target (directory, zip, or both), module packaging mode (slim vs. full), user inclusion, secret scrubbing, and post-install finish script options. Reusable presets live in site/profiles/*.json alongside three built-in recipes (public-starter, client-handoff, internal-clone).

To avoid PHP execution timeouts on large sites, ChunkedExportRunner breaks export execution into locked, resumable steps (startJob() -> runStep() -> runAll()) protected by ProfileRepository::withJobLock() and withSlugLock(), or executes headlessly via ExportProfileQueue.

After packaging completes, ProfileVerifier::verify() validates the exported directory and/or ZIP structure (install/info.php, install/install.sql, config.php) and scans for any literal secret needles collected by SecretScanner::collectRedactedSecretValuesForPlan() to guarantee zero accidental credential leaks.

Next steps