Add allow_anonymous_stats

This commit is contained in:
Anton Medvedev 2017-05-14 21:58:29 +07:00
parent 64f5bbce7a
commit 5f2d07369d
2 changed files with 6 additions and 1 deletions

View File

@ -137,7 +137,8 @@ class InitCommand extends Command
'This function will not affect the performance of Deployer as',
'the data is insignificant and transmitted in separate process.',
]);
$params['allow_anonymous_stats'] = $io->confirm('Do you confirm?');
$params['allow_anonymous_stats'] = $GLOBALS['allow_anonymous_stats'] = $io->confirm('Do you confirm?');
}
$filePath = $this->initializer->initialize($template, $directory, $file, $params);

View File

@ -347,6 +347,10 @@ class Deployer extends Container
$stats['exception'] = get_class($commandEvent->getException());
}
if ($stats['command_name'] === 'init') {
$stats['allow_anonymous_stats'] = $GLOBALS['allow_anonymous_stats'] ?? false;
}
if ($stats['command_name'] === 'worker') {
return;
}