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

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