protected function loadInformationCollector()
{
$ic = new InformationCollector();
// Add a specific option if it's the first release
try {
Context::get('version-persister')->getCurrentVersion();
} catch (\Liip\RMT\Exception\NoReleaseFoundException $e) {
$ic->registerRequest(new InformationRequest('confirm-first', array('description' => 'This is the first release for the current branch', 'type' => 'confirmation')));
} catch (\Exception $e) {
echo 'Error while trying to read the current version';
}
// Register options of the release tasks
$ic->registerRequests(Context::get('version-generator')->getInformationRequests());
$ic->registerRequests(Context::get('version-persister')->getInformationRequests());
// Register options of all lists (prerequistes and actions)
foreach (array('prerequisites', 'pre-release-actions', 'post-release-actions') as $listName) {
foreach (Context::getInstance()->getList($listName) as $listItem) {
$ic->registerRequests($listItem->getInformationRequests());
}
}
Context::getInstance()->setService('information-collector', $ic);
}