vendor/blackbit/data-director/BlackbitDataDirectorBundle.php line 20

Open in your IDE?
  1. <?php
  2. /**
  3.  * Copyright Blackbit digital Commerce GmbH <info@blackbit.de>
  4.  *
  5.  * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
  6.  *
  7.  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  8.  *
  9.  * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  10.  */
  11. namespace Blackbit\DataDirectorBundle;
  12. use Blackbit\DataDirectorBundle\lib\Pim\Logger\Logger;
  13. use Blackbit\DataDirectorBundle\Tools\Installer;
  14. use Pimcore\Db;
  15. use Pimcore\Extension\Bundle\AbstractPimcoreBundle;
  16. use Pimcore\Extension\Bundle\Traits\PackageVersionTrait;
  17. class BlackbitDataDirectorBundle extends AbstractPimcoreBundle
  18. {
  19.     use PackageVersionTrait {
  20.         getVersion as protected getComposerVersion;
  21.     }
  22.     /**
  23.      * @return Installer
  24.      */
  25.     public function getInstaller()
  26.     {
  27.         return $this->container->get(Installer::class);
  28.     }
  29.     /**
  30.      * @return string[]
  31.      */
  32.     public function getJsPaths()
  33.     {
  34.         $return = [
  35.             '/bundles/blackbitdatadirector/js/fieldType/calculateValueDataQuerySelector/data.js',
  36.             '/bundles/blackbitdatadirector/js/fieldType/calculateValueDataQuerySelector/tag.js',
  37.             '/bundles/blackbitdatadirector/js/fieldType/inputWithPlaceholders/data.js',
  38.             '/bundles/blackbitdatadirector/js/fieldType/inputWithPlaceholders/tag.js',
  39.             '/bundles/blackbitdatadirector/js/fieldType/textareaWithPlaceholders/data.js',
  40.             '/bundles/blackbitdatadirector/js/fieldType/textareaWithPlaceholders/tag.js',
  41.             '/bundles/blackbitdatadirector/js/fieldType/htmlContainer/data.js',
  42.             '/bundles/blackbitdatadirector/js/fieldType/htmlContainer/tag.js',
  43.             '/bundles/blackbitdatadirector/js/ImportConfig.js',
  44.             '/bundles/blackbitdatadirector/js/plugin.js',
  45.             '/bundles/blackbitdatadirector/js/components/DataportPanel.js',
  46.             '/bundles/blackbitdatadirector/js/components/DataportPreview.js',
  47.             '/bundles/blackbitdatadirector/js/components/ManualImport.js',
  48.             '/bundles/blackbitdatadirector/js/components/MappingPanel.js',
  49.             '/bundles/blackbitdatadirector/js/gridOperatorDataQuerySelector.js',
  50.             '/bundles/blackbitdatadirector/js/gridExport.js',
  51.             '/bundles/blackbitdatadirector/js/gridExportCsv.js',
  52.             '/bundles/blackbitdatadirector/js/gridExportXml.js',
  53.             '/bundles/blackbitdatadirector/js/gridExportJson.js',
  54.             '/bundles/blackbitdatadirector/js/reportAdapter.js',
  55.             '/bundles/blackbitdatadirector/js/components/VersionPanel.js',
  56.         ];
  57.         if(!file_exists(PIMCORE_WEB_ROOT.'/bundles/pimcoreadmin/js/lib/ace')) {
  58.             $return[] = '/bundles/blackbitdatadirector/vendor/ace/ace.js';
  59.         }
  60.         $return[] = '/bundles/blackbitdatadirector/vendor/ace/ext-language_tools.js';
  61.         return $return;
  62.     }
  63.     /**
  64.      * @return string[]
  65.      */
  66.     public function getCssPaths()
  67.     {
  68.         return [
  69.             '/bundles/blackbitdatadirector/css/pim.css',
  70.             '/bundles/blackbitdatadirector/vendor/php-diff/diff-table.css'
  71.         ];
  72.     }
  73.     /**
  74.      * Returns the composer package name used to resolve the version
  75.      *
  76.      * @return string
  77.      */
  78.     protected function getComposerPackageName(): string
  79.     {
  80.         return 'blackbit/data-director';
  81.     }
  82.     /**
  83.      * @return string
  84.      */
  85.     public function getVersion()
  86.     {
  87.         try {
  88.             return $this->getComposerVersion();
  89.         } catch (\Exception $e) {
  90.             return 'unknown';
  91.         }
  92.     }
  93. }