vendor/coreshop/pimcore-bundle/CoreShopPimcoreBundle.php line 28

Open in your IDE?
  1. <?php
  2. /**
  3.  * CoreShop.
  4.  *
  5.  * This source file is subject to the GNU General Public License version 3 (GPLv3)
  6.  * For the full copyright and license information, please view the LICENSE.md and gpl-3.0.txt
  7.  * files that are distributed with this source code.
  8.  *
  9.  * @copyright  Copyright (c) CoreShop GmbH (https://www.coreshop.org)
  10.  * @license    https://www.coreshop.org/license     GNU General Public License version 3 (GPLv3)
  11.  */
  12. declare(strict_types=1);
  13. namespace CoreShop\Bundle\PimcoreBundle;
  14. use Composer\InstalledVersions;
  15. use CoreShop\Bundle\CoreBundle\Application\Version;
  16. use CoreShop\Bundle\PimcoreBundle\DependencyInjection\Compiler\ExpressionLanguageServicePass;
  17. use CoreShop\Bundle\PimcoreBundle\DependencyInjection\Compiler\RegisterGridActionPass;
  18. use CoreShop\Bundle\PimcoreBundle\DependencyInjection\Compiler\RegisterGridFilterPass;
  19. use CoreShop\Bundle\PimcoreBundle\DependencyInjection\Compiler\RegisterPimcoreDocumentTagImplementationLoaderPass;
  20. use CoreShop\Bundle\PimcoreBundle\DependencyInjection\Compiler\RegisterPimcoreDocumentTagPass;
  21. use CoreShop\Bundle\PimcoreBundle\DependencyInjection\Compiler\RegisterTypeHintRegistriesPass;
  22. use Pimcore\Extension\Bundle\AbstractPimcoreBundle;
  23. use Symfony\Component\DependencyInjection\ContainerBuilder;
  24. final class CoreShopPimcoreBundle extends AbstractPimcoreBundle
  25. {
  26.     public function getNiceName(): string
  27.     {
  28.         return 'CoreShop - Pimcore';
  29.     }
  30.     public function getDescription(): string
  31.     {
  32.         return 'CoreShop - Pimcore Bundle';
  33.     }
  34.     public function getVersion(): string
  35.     {
  36.         $bundleName 'coreshop/pimcore-bundle';
  37.         if (class_exists(InstalledVersions::class)) {
  38.             if (InstalledVersions::isInstalled('coreshop/core-shop')) {
  39.                 return InstalledVersions::getVersion('coreshop/core-shop');
  40.             }
  41.             if (InstalledVersions::isInstalled($bundleName)) {
  42.                 return InstalledVersions::getVersion($bundleName);
  43.             }
  44.         }
  45.         if (class_exists(Version::class)) {
  46.             return Version::getVersion();
  47.         }
  48.         return '';
  49.     }
  50.     public function build(ContainerBuilder $container): void
  51.     {
  52.         parent::build($container);
  53.         $container->addCompilerPass(new RegisterGridActionPass());
  54.         $container->addCompilerPass(new RegisterGridFilterPass());
  55.         $container->addCompilerPass(new RegisterPimcoreDocumentTagImplementationLoaderPass());
  56.         $container->addCompilerPass(new RegisterPimcoreDocumentTagPass());
  57.         $container->addCompilerPass(new ExpressionLanguageServicePass());
  58.         $container->addCompilerPass(new RegisterTypeHintRegistriesPass());
  59.     }
  60. }