Skip to content

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.

Implement Totoglu\ProcessReactExportProfile\Contributor\ProfileContributorInterface and return a ContributorRuleSet describing:

  • tables: Map custom SQL table names to 'schema-only' (export CREATE TABLE structure without runtime logs/rows) or 'full' / 'exclude'.
  • secretKeys: Module config or entry keys whose values must be automatically scrubbed by SecretScanner and verified absent by ProfileVerifier.
  • excludePaths: Relative cache or scratch directories under site/ 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());
});

Call $runtime->collectRulesWithModuleHook() on ExportProfileRuntime to gather all built-in, module-manifest, and hook-registered ContributorRuleSet rules merged into a MergedContributorRules object.

Next steps