public function updateBundlesData()
{
$this->output->writeln(sprintf('[%s] Will now update commits, files and tags', date('d-m-y H:i:s')));
$unitOfWork = $this->em->getUnitOfWork();
$page = 1;
$pager = $this->paginateExistingBundles($page);
do {
// Now update bundles with more precise GitHub data
/** @var $bundle Bundle */
foreach ($pager->getCurrentPageResults() as $bundle) {
if (UnitOfWork::STATE_MANAGED !== $unitOfWork->getEntityState($bundle)) {
continue;
}
$this->updateRepo($bundle);
}
++$page;
} while ($pager->hasNextPage() && $pager->setCurrentPage($page, false, true));
}
/** * {@inheritdoc} * * @throws \InvalidArgumentException When the target directory does not exist */ protected function execute(InputInterface $input, OutputInterface $output) { $gitRepoDir = $this->getContainer()->getParameter('knp_bundles.bundles_dir'); $gitBin = $this->getContainer()->getParameter('knp_bundles.git_bin'); $em = $this->getContainer()->get('knp_bundles.entity_manager'); $updater = new Updater($em, $gitRepoDir, $gitBin, $output); $updater->setUp(); $updater->updateBundlesData(); $em->flush(); }