5 * Validate and create the template compile folder.
8 if (!defined('CIVI_SETUP')) {
9 exit("Installation plugins must only be loaded by the installer.\n");
12 \Civi\Setup
::dispatcher()
13 ->addListener('civi.setup.checkRequirements', function (\Civi\Setup\Event\CheckRequirementsEvent
$e) {
14 \Civi\Setup
::log()->info(sprintf('[%s] Handle %s', basename(__FILE__
), 'checkRequirements'));
17 if (empty($m->templateCompilePath
)) {
18 $e->addError('system', 'templateCompilePath', sprintf('The templateCompilePath is undefined.'));
21 $e->addInfo('system', 'templateCompilePath', 'The templateCompilePath is defined.');
24 if (!\Civi\Setup\FileUtil
::isCreateable($m->templateCompilePath
)) {
25 $e->addError('system', 'templateCompilePathWritable', sprintf('The template compile dir "%s" cannot be created. Ensure the parent folder is writable.', $m->templateCompilePath
));
28 $e->addInfo('system', 'templateCompilePathWritable', sprintf('The template compile dir "%s" can be created.', $m->templateCompilePath
));
32 \Civi\Setup
::dispatcher()
33 ->addListener('civi.setup.installFiles', function (\Civi\Setup\Event\InstallFilesEvent
$e) {
34 \Civi\Setup
::log()->info(sprintf('[%s] Handle %s', basename(__FILE__
), 'installFiles'));
37 if (!file_exists($m->templateCompilePath
)) {
38 Civi\Setup
::log()->info('[CreateTemplateCompilePath.civi-setup.php] mkdir "{path}"', [
39 'path' => $m->templateCompilePath
,
41 mkdir($m->templateCompilePath
, 0777, TRUE);
42 \Civi\Setup\FileUtil
::makeWebWriteable($m->templateCompilePath
);