Skip to content

Commit

Permalink
Add profiling support for process execution mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanlins committed Nov 6, 2014
1 parent 4b120a9 commit 620fed5
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 14 deletions.
23 changes: 16 additions & 7 deletions src/system/modules/!composer/dca/tl_settings.php
Expand Up @@ -21,8 +21,10 @@
';{composer_legend:hide},composerAutoUpdateLibrary,' .
'composerExecutionMode,composerVerbosity,composerRemoveRepositoryTables';

$GLOBALS['TL_DCA']['tl_settings']['subpalettes']['composerExecutionMode_process'] = 'composerPhpPath';
$GLOBALS['TL_DCA']['tl_settings']['subpalettes']['composerExecutionMode_detached'] = 'composerPhpPath';
$GLOBALS['TL_DCA']['tl_settings']['subpalettes']['composerExecutionMode_process'] =
'composerPhpPath,composerProfiling';
$GLOBALS['TL_DCA']['tl_settings']['subpalettes']['composerExecutionMode_detached'] =
'composerPhpPath,composerProfiling';


/**
Expand All @@ -49,17 +51,17 @@
'inputType' => 'text',
'eval' => array(
'mandatory' => true,
'tl_class' => 'w50',
'tl_class' => 'clr long',
'allowHtml' => true,
'preserveTags' => true,
'decodeEntities' => true,
),
);
$GLOBALS['TL_DCA']['tl_settings']['fields']['composerRemoveRepositoryTables'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_settings']['composerRemoveRepositoryTables'],
$GLOBALS['TL_DCA']['tl_settings']['fields']['composerProfiling'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_settings']['composerProfiling'],
'inputType' => 'checkbox',
'eval' => array(
'tl_class' => 'clr m12 w50',
'tl_class' => 'm12 w50',
),
);
$GLOBALS['TL_DCA']['tl_settings']['fields']['composerVerbosity'] = array(
Expand All @@ -74,7 +76,14 @@
),
'reference' => $GLOBALS['TL_LANG']['tl_settings']['composerVerbosityLevels'],
'eval' => array(
'tl_class' => 'w50',
'tl_class' => 'clr w50',
'helpwizard' => true,
),
);
$GLOBALS['TL_DCA']['tl_settings']['fields']['composerRemoveRepositoryTables'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_settings']['composerRemoveRepositoryTables'],
'inputType' => 'checkbox',
'eval' => array(
'tl_class' => 'm12 w50',
),
);
17 changes: 10 additions & 7 deletions src/system/modules/!composer/languages/en/tl_settings.php
Expand Up @@ -3,11 +3,11 @@
/**
* Fields
*/
$GLOBALS['TL_LANG']['tl_settings']['composerAutoUpdateLibrary'] = array(
$GLOBALS['TL_LANG']['tl_settings']['composerAutoUpdateLibrary'] = array(
'Update composer library automatically',
'The composer library (also known as <code>composer.phar</code>) will be updated after 30 days automatically.'
);
$GLOBALS['TL_LANG']['tl_settings']['composerExecutionMode'] = array(
$GLOBALS['TL_LANG']['tl_settings']['composerExecutionMode'] = array(
'Execution mode',
'Please select how the composer binary shall get executed.'
);
Expand All @@ -20,11 +20,14 @@
'The old ER2 repository client tables will not be removed by the composer client database update tool, ' .
'until you enable this checkbox.'
);

$GLOBALS['TL_LANG']['tl_settings']['composerVerbosity'] = array(
'Verbosity in logging',
'The console has 5 levels of verbosity, ' .
'usually you will want to leave this to the default verbosity unless you experience problems.'
$GLOBALS['TL_LANG']['tl_settings']['composerProfiling'] = array(
'Enable profiling',
'Display timing and memory usage information.'
);
$GLOBALS['TL_LANG']['tl_settings']['composerRemoveRepositoryTables'] = array(
'Remove repository client tables',
'The old ER2 repository client tables will not be removed by the composer client database update tool, ' .
'until you enable this checkbox.'
);


Expand Down
Expand Up @@ -192,6 +192,10 @@ private function buildCmd($packages, $dryRun)
default:
}

if ($GLOBALS['TL_CONFIG']['composerProfiling']) {
$cmd .= ' --profile';
}

return $cmd;
}

Expand Down

0 comments on commit 620fed5

Please sign in to comment.