vendor/coreshop/core-shop/src/CoreShop/Bundle/FrontendBundle/CoreShopFrontendBundle.php line 30

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\FrontendBundle;
  17. use Composer\InstalledVersions;
  18. use CoreShop\Bundle\CoreBundle\CoreShopCoreBundle;
  19. use CoreShop\Bundle\FrontendBundle\DependencyInjection\CompilerPass\RegisterFrontendControllerPass;
  20. use EmailizrBundle\EmailizrBundle;
  21. use Pimcore\Extension\Bundle\AbstractPimcoreBundle;
  22. use Pimcore\HttpKernel\Bundle\DependentBundleInterface;
  23. use Pimcore\HttpKernel\BundleCollection\BundleCollection;
  24. use Symfony\Component\DependencyInjection\ContainerBuilder;
  25. final class CoreShopFrontendBundle extends AbstractPimcoreBundle implements DependentBundleInterface
  26. {
  27.     public static function registerDependentBundles(BundleCollection $collection): void
  28.     {
  29.         $collection->addBundle(new CoreShopCoreBundle(), 1600);
  30.         $collection->addBundle(new EmailizrBundle(), 1000);
  31.     }
  32.     public function build(ContainerBuilder $container): void
  33.     {
  34.         parent::build($container);
  35.         $container->addCompilerPass(new RegisterFrontendControllerPass());
  36.     }
  37.     public function getNiceName(): string
  38.     {
  39.         return 'CoreShop - Frontend';
  40.     }
  41.     public function getDescription(): string
  42.     {
  43.         return 'CoreShop - Frontend Bundle';
  44.     }
  45.     public function getVersion(): string
  46.     {
  47.         if (class_exists('\\CoreShop\\Bundle\\CoreBundle\\Application\\Version')) {
  48.             return \CoreShop\Bundle\CoreBundle\Application\Version::getVersion() . ' (' $this->getComposerVersion() . ')';
  49.         }
  50.         return $this->getComposerVersion();
  51.     }
  52.     public function getComposerVersion(): string
  53.     {
  54.         $bundleName 'coreshop/frontend-bundle';
  55.         if (class_exists(InstalledVersions::class)) {
  56.             if (InstalledVersions::isInstalled('coreshop/core-shop')) {
  57.                 return InstalledVersions::getPrettyVersion('coreshop/core-shop');
  58.             }
  59.             if (InstalledVersions::isInstalled($bundleName)) {
  60.                 return InstalledVersions::getPrettyVersion($bundleName);
  61.             }
  62.         }
  63.         return '';
  64.     }
  65. }