/** * @param InputInterface $input * @param OutputInterface $output * * @return int */ protected function execute(InputInterface $input, OutputInterface $output) { $output->writeln('<comment>Start dumping...</comment>'); $this->serviceManager = $this->getContainer()->get('sitemap'); $this->dumpEntity = $this->serviceManager->createDumpEntity()->setCarefully($input->hasArgument('carefully') ? $input->getArgument('carefully') : false)->setWebDir(realpath($this->getContainer()->get('kernel')->getRootDir() . '/../web')); $this->setEntities(); $dumpManager = $this->serviceManager->createDumpManager(); if (!empty($this->siteMapEntity)) { $this->dumpEntity->setSiteMapEntity($this->siteMapEntity); } if (!empty($this->siteMapIndexEntity)) { $this->dumpEntity->setSiteMapIndexEntity($this->siteMapIndexEntity); } $dumpManager->setEntity($this->dumpEntity); if (!empty($this->siteMapEntity)) { $dumpManager->dumpSiteMap(); } if (!empty($this->siteMapIndexEntity)) { $dumpManager->dumpSiteMapIndex(); } $output->writeln('<info>Done</info>'); return 0; }
/** * */ public function testCreateDumpManager() { $this->assertInstanceOf('Evheniy\\SitemapXmlBundle\\Dump\\DumpManager', $this->serviceManager->createDumpManager('path')); }