/** * Creates a big collection of node for performance benchmarking * @param string $siteNode * @param string $preset */ public function nodesCommand($siteNode, $preset) { if (!isset($this->presets[$preset])) { $this->outputLine('Error: Invalid preset'); $this->quit(1); } $preset = $this->presets[$preset]; /** @var Site $currentSite */ $currentSite = $this->siteRepository->findOneByNodeName($siteNode); if ($currentSite === null) { $this->outputLine('Error: No site for exporting found'); $this->quit(1); } /** @var ContentContext $contentContext */ $contentContext = $this->createContext($currentSite, 'live'); $workspace = 'live'; if ($this->workspaceRepository->findByName($workspace)->count() === 0) { $this->outputLine('Workspace "%s" does not exist', array($workspace)); $this->quit(1); } /** @var Node $siteNode */ $siteNode = $contentContext->getCurrentSiteNode(); if ($siteNode === null) { $this->outputLine('Error: No site root node'); $this->quit(1); } $preset = new PresetDefinition($siteNode, $preset); $generator = new NodesGenerator($preset); $generator->generate(); }