Search Kit - Auto-enable during normal installation
authorTim Otten <totten@civicrm.org>
Tue, 15 Mar 2022 20:44:36 +0000 (13:44 -0700)
committerTim Otten <totten@civicrm.org>
Tue, 15 Mar 2022 20:44:36 +0000 (13:44 -0700)
setup/plugins/init/DefaultExtensions.civi-setup.php [new file with mode: 0644]

diff --git a/setup/plugins/init/DefaultExtensions.civi-setup.php b/setup/plugins/init/DefaultExtensions.civi-setup.php
new file mode 100644 (file)
index 0000000..f3498da
--- /dev/null
@@ -0,0 +1,22 @@
+<?php
+/**
+ * @file
+ *
+ * This is an example plugin which manipulates the installation options.
+ *
+ * Note: The filename `Example.disabled.php` indicates that the example is
+ * a disabled. A real plugin must end in `*.civi-setup.php`.
+ */
+
+if (!defined('CIVI_SETUP')) {
+  exit("Installation plugins must only be loaded by the installer.\n");
+}
+
+\Civi\Setup::dispatcher()
+  ->addListener('civi.setup.init', function (\Civi\Setup\Event\InitEvent $e) {
+    \Civi\Setup::log()->info(sprintf('[%s] Handle %s', basename(__FILE__), 'init'));
+
+    // Activate some extensions during installation.
+    $e->getModel()->extensions[] = 'org.civicrm.search_kit';
+
+  });