Contributors & Extensibility
First-party modules (like Account, Ai, Headless, Payments) and your own project modules integrate with ProcessReactExportProfile through ProfileContributorInterface and the ProcessReactExportProfile::collectContributors hook.
Implementing ProfileContributorInterface
Section titled “Implementing ProfileContributorInterface”Implement Totoglu\ProcessReactExportProfile\Contributor\ProfileContributorInterface and return a ContributorRuleSet describing:
tables: Map custom SQL table names to'schema-only'(exportCREATE TABLEstructure without runtime logs/rows) or'full'/'exclude'.secretKeys: Module config or entry keys whose values must be automatically scrubbed bySecretScannerand verified absent byProfileVerifier.excludePaths: Relative cache or scratch directories undersite/to omit from exported archives.
<?php declare(strict_types=1);
namespace ProcessWire;
use Totoglu\ProcessReactExportProfile\Contributor\ContributorCollector;use Totoglu\ProcessReactExportProfile\Contributor\ContributorRuleSet;use Totoglu\ProcessReactExportProfile\Contributor\ProfileContributorInterface;
final class AegeanProfileContributor implements ProfileContributorInterface{ public function contribute(ProcessWire $wire): ContributorRuleSet { return ContributorRuleSet::fromArray([ 'tables' => [ 'aegean_webhook_logs' => 'schema-only', ], 'secretKeys' => [ 'marina_api_token', 'ais_vessel_secret', ], 'excludePaths' => [ 'site/assets/cache/ais-feed/', ], ], 'aegean-voyages', 'AegeanCharter'); }}
// Register in site/ready.php$wire->addHookAfter('ProcessReactExportProfile::collectContributors', static function (HookEvent $event): void { /** @var ContributorCollector $collector */ $collector = $event->arguments(0); $collector->add(new AegeanProfileContributor());});Collecting Merged Rules Programmatically
Section titled “Collecting Merged Rules Programmatically”Call $runtime->collectRulesWithModuleHook() on ExportProfileRuntime to gather all built-in, module-manifest, and hook-registered ContributorRuleSet rules merged into a MergedContributorRules object.