}
// @todo Somewhere in 2024 or beyond, deprecate the old installer
file_put_contents('../install/langs.php', "<?php \$langs = " . var_export($langs, TRUE) . ";");
- file_put_contents('../setup/res/languages.php', "<?php\n\n\Civi\Setup::assertRunning();\n\n\$langs = " . var_export($langs, TRUE) . ";");
+
+ // The `Template` helper provides PHP code cleanup.
+ $tpl = new CRM_Core_CodeGen_Util_Template('php');
+ $tpl->assign('langs', var_export($langs, TRUE));
+ $tpl->run('languages_setup.tpl', '../setup/res/languages.php');
}
public function generateSchemaStructure(): void {