コード例 #1
0
ファイル: ThemeExtractor.php プロジェクト: M03G/PrestaShop
 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));
 }
コード例 #2
0
ファイル: Shop.php プロジェクト: M03G/PrestaShop
 /**
  * Get theme directory name
  *
  * @return string $this->theme->theme_name
  */
 public function getTheme()
 {
     Tools::displayAsDeprecated('Please use $this->theme->getDirectory() instead');
     return $this->theme->getDirectory();
 }