Commit | Line | Data |
---|---|---|
4bcd4c62 TO |
1 | <?php |
2 | /** | |
3 | * @file | |
4 | * | |
5 | * This is an example plugin which manipulates the installation options. | |
6 | * | |
7 | * Note: The filename `Example.disabled.php` indicates that the example is | |
8 | * a disabled. A real plugin must end in `*.civi-setup.php`. | |
9 | */ | |
10 | ||
11 | if (!defined('CIVI_SETUP')) { | |
12 | exit("Installation plugins must only be loaded by the installer.\n"); | |
13 | } | |
14 | ||
15 | \Civi\Setup::dispatcher() | |
16 | ->addListener('civi.setup.init', function (\Civi\Setup\Event\InitEvent $e) { | |
17 | \Civi\Setup::log()->info(sprintf('[%s] Handle %s', basename(__FILE__), 'init')); | |
18 | ||
19 | // Override the default list of Civi components. | |
20 | $e->getModel()->components = array('CiviEvent', 'CiviContribute', 'CiviMember', 'CiviMail'); | |
21 | ||
22 | // Activate some extensions during installation. | |
23 | $e->getModel()->extensions[] = 'org.civicrm.flexmailer'; | |
24 | ||
25 | // Manipulate some settings during installation. | |
26 | $e->getModel()->settings['max_attachments'] = 10; | |
27 | }); |