vendor/coreshop/core-shop/src/CoreShop/Bundle/SEOBundle/CoreShopSEOBundle.php line 26

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\SEOBundle;
  17. use Composer\InstalledVersions;
  18. use CoreShop\Bundle\SEOBundle\DependencyInjection\Compiler\ExtractorRegistryServicePass;
  19. use Pimcore\Extension\Bundle\AbstractPimcoreBundle;
  20. use Symfony\Component\DependencyInjection\ContainerBuilder;
  21. final class CoreShopSEOBundle extends AbstractPimcoreBundle
  22. {
  23.     public function build(ContainerBuilder $container): void
  24.     {
  25.         parent::build($container);
  26.         $container->addCompilerPass(new ExtractorRegistryServicePass());
  27.     }
  28.     public function getNiceName(): string
  29.     {
  30.         return 'CoreShop - SEO';
  31.     }
  32.     public function getDescription(): string
  33.     {
  34.         return 'CoreShop - SEO Bundle';
  35.     }
  36.     public function getVersion(): string
  37.     {
  38.         if (class_exists('\\CoreShop\\Bundle\\CoreBundle\\Application\\Version')) {
  39.             return \CoreShop\Bundle\CoreBundle\Application\Version::getVersion() . ' (' $this->getComposerVersion() . ')';
  40.         }
  41.         return $this->getComposerVersion();
  42.     }
  43.     public function getComposerVersion(): string
  44.     {
  45.         $bundleName 'coreshop/seo-bundle';
  46.         if (class_exists(InstalledVersions::class)) {
  47.             if (InstalledVersions::isInstalled('coreshop/core-shop')) {
  48.                 return InstalledVersions::getPrettyVersion('coreshop/core-shop');
  49.             }
  50.             if (InstalledVersions::isInstalled($bundleName)) {
  51.                 return InstalledVersions::getPrettyVersion($bundleName);
  52.             }
  53.         }
  54.         return '';
  55.     }
  56. }