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.     public function getInstaller()
  23.     {
  24.         return $this->container->get(Installer::class);
  25.     }
  26.     public function getJsPaths()
  27.     {
  28.         $return = [
  29.             '/bundles/blackbitdatadirector/js/fieldType/calculateValueDataQuerySelector/data.js',
  30.             '/bundles/blackbitdatadirector/js/fieldType/calculateValueDataQuerySelector/tag.js',
  31.             '/bundles/blackbitdatadirector/js/fieldType/inputWithPlaceholders/data.js',
  32.             '/bundles/blackbitdatadirector/js/fieldType/inputWithPlaceholders/tag.js',
  33.             '/bundles/blackbitdatadirector/js/fieldType/textareaWithPlaceholders/data.js',
  34.             '/bundles/blackbitdatadirector/js/fieldType/textareaWithPlaceholders/tag.js',
  35.             '/bundles/blackbitdatadirector/js/ImportConfig.js',
  36.             '/bundles/blackbitdatadirector/js/plugin.js',
  37.             '/bundles/blackbitdatadirector/js/components/DataportPanel.js',
  38.             '/bundles/blackbitdatadirector/js/components/DataportPreview.js',
  39.             '/bundles/blackbitdatadirector/js/components/ManualImport.js',
  40.             '/bundles/blackbitdatadirector/js/components/MappingPanel.js',
  41.             '/bundles/blackbitdatadirector/js/gridOperatorDataQuerySelector.js',
  42.             '/bundles/blackbitdatadirector/js/gridExport.js',
  43.             '/bundles/blackbitdatadirector/js/gridExportCsv.js',
  44.             '/bundles/blackbitdatadirector/js/gridExportXml.js',
  45.             '/bundles/blackbitdatadirector/js/gridExportJson.js',
  46.             '/bundles/blackbitdatadirector/js/reportAdapter.js',
  47.             '/bundles/blackbitdatadirector/js/components/VersionPanel.js',
  48.         ];
  49.         if(!file_exists(PIMCORE_WEB_ROOT.'/bundles/pimcoreadmin/js/lib/ace')) {
  50.             $return[] = '/bundles/blackbitdatadirector/vendor/ace/ace.js';
  51.         }
  52.         $return[] = '/bundles/blackbitdatadirector/vendor/ace/ext-language_tools.js';
  53.         return $return;
  54.     }
  55.     public function getCssPaths()
  56.     {
  57.         return [
  58.             '/bundles/blackbitdatadirector/css/pim.css',
  59.             '/bundles/blackbitdatadirector/vendor/php-diff/diff-table.css'
  60.         ];
  61.     }
  62.     /**
  63.      * Returns the composer package name used to resolve the version
  64.      *
  65.      * @return string
  66.      */
  67.     protected function getComposerPackageName(): string
  68.     {
  69.         return 'blackbit/data-director';
  70.     }
  71.     public function getVersion()
  72.     {
  73.         try {
  74.             return $this->getComposerVersion();
  75.         } catch (\Exception $e) {
  76.             return 'unknown';
  77.         }
  78.     }
  79. }