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 admin views.

actionGenerateAdminCache(string $sAdminDir = null)

NOTE: It's a recursive function which build every twig file in admin area.

Arguments

$sAdminDir

string

the directory to parse, where to find the twig files.

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 question theme

actionGenerateQuestionThemesCache(string $themesRootDir = null)

Arguments

$themesRootDir

string

the directory to parse, where to find the manifests.

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, $bGenerateAdminCache = true, $bGenerateQuestionThemeCache = true)

Arguments

$sThemeDir

$bGenerateSurveyCache

$bGenerateQuestionsCache

$bGenerateAdminCache

$bGenerateQuestionThemeCache

actionIndex

actionIndex()

Finds all subfolders of $questionThemeDirectory containing XML files

getQuestionThemePaths(string $questionThemeDirectory): array

Arguments

$questionThemeDirectory

string

Response

array

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)