public function extract(Theme $theme, $locale = 'en-US') { $this->catalog = new MessageCatalogue($locale); // remove the last "/" $themeDirectory = substr($theme->getDirectory(), 0, -1); $options = array('path' => $themeDirectory); $this->smartyExtractor->extract($themeDirectory, $this->catalog); if ($this->overrideFromDatabase) { $this->overrideFromDatabase($theme->getName(), $locale, $this->catalog); } foreach ($this->dumpers as $dumper) { if ($this->format === $dumper->getExtension()) { if (null !== $this->outputPath) { $options['path'] = $this->outputPath; } return $dumper->dump($this->catalog, $options); } } throw new \LogicException(sprintf('The format %s is not supported.', $this->format)); }