TwigCommand

Extends \CConsoleCommand

This class will generate all the twig cache file from command line, even if LimeSurvey is not installed.

The current use case is to generate the translation files using Glot Press. In the future, it could be use to boost performance of first survey rendering (can be useful after a tmp cleanup, an update, etc).

To execute this command : php application/commands/console.php Twig generateTwigTmpFiles

It will execute all the functions

package

Default

Methods

Generate twig cache files for each question type.

actionGenerateQuestionsCache(string $sQuestionDir = null) 

NOTE 1: It's a recursive function, since some directories are the question type itself (it has an answer.twig file) but other containes various question types as subdirectories. NOTE 2: Currenlty arrays are skipped. We need to set default data, so it will be done in LS4, at the same time than Question Theme Editor.

Arguments

$sQuestionDir

string

the directory to parse, where to find the answer.twig file.

Generate twig cache files for each core survey theme

actionGenerateSurveyThemesCache(string $sThemeDir = null) 

Arguments

$sThemeDir

string

the directory to parse, where to find the manifests.

Generate twig cache files for each core Survey Theme and core questions views.

actionGenerateTwigTmpFiles( $sThemeDir = null,  $bGenerateSurveyCache = true,  $bGenerateQuestionsCache = true,  $bShowLogs = false) 

Arguments

$sThemeDir

$bGenerateSurveyCache

$bGenerateQuestionsCache

$bShowLogs

actionIndex

actionIndex() 

Load the needed helpers, set default vaules, etc

init() 

Generate the cache for a given survey theme

renderSurveyTheme( $oTemplateForPreview) 

Arguments

$oTemplateForPreview

Generate the cache for the twig strings inside the manifest itself

renderSurveyThemeManifest( $oTemplateForPreview) 

Arguments

$oTemplateForPreview

Properties

aLogs

aLogs : 

Type(s)