# Shopware-Version im Plugin auslesen

**URL:** <https://forum.shopware.com/t/shopware-version-im-plugin-auslesen/41285>\
**Category:** Programmierung\
**Created:** [11. November 2016 um 12:17 UTC](https://forum.shopware.com/t/shopware-version-im-plugin-auslesen/41285 "2016-11-11T12:17:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mfischer1620](https://avatars.discourse-cdn.com/v4/letter/m/9de0a6/32.png) [@mfischer1620](https://forum.shopware.com/u/mfischer1620)\
**Post date:** [11. November 2016 um 12:17 UTC](https://forum.shopware.com/t/shopware-version-im-plugin-auslesen/41285/1 "2016-11-11T12:17:42Z")

</div>

Hallo,

habe folgenden Ansatz um die Shopwareversion in meinem Plugin zu bekommen

```
$version = Shopware()->Config()->get('Version');

```

Ich jedoch nun die Variable wie folgt ausgebe

```
print_r($version);

```

so wird mir nichts angezeigt.  
Gibt es dazu eine Idee?

[https://forum.shopware.com/discussion/33259/aktuelle-shopware-version-in-plugin-abfragen](https://forum.shopware.com/discussion/33259/aktuelle-shopware-version-in-plugin-abfragen)

```
    /**
     * Compare versions.
     * @param string $version Like: 5.0.0
     * @param string $operator Like: <=
     *
     * @return mixed
    */
    public function versionCompare( $version, $operator )
    {
        // return by default version compare
        return version_compare( Shopware()->Config()->get( 'Version' ), $version, $operator );
    }
 
    /**
     * Check if current environment is shopware 5.
     *
     * @return bool
     */
    public function isShopware5()
    {
        // return if this is shopware 5
        return $this->versionCompare( '5.0.0', '>=' );
    }

```

&nbsp;

Dieser Artikel mit seiner Loesung brachte mir auch keine Loesung.

---

<div class="post-metadata">

**Author:** ![ahmadsaad](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@ahmadsaad](https://forum.shopware.com/u/ahmadsaad)\
**Post date:** [11. November 2016 um 13:33 UTC](https://forum.shopware.com/t/shopware-version-im-plugin-auslesen/41285/2 "2016-11-11T13:33:53Z")

</div>

Sie können einfach benutzen:

```
Shopware::VERSION

```

Viele Grüße,

Ahmad.

---

<div class="post-metadata">

**Author:** ![mfischer1620](https://avatars.discourse-cdn.com/v4/letter/m/9de0a6/32.png) [@mfischer1620](https://forum.shopware.com/u/mfischer1620)\
**Post date:** [11. November 2016 um 16:02 UTC](https://forum.shopware.com/t/shopware-version-im-plugin-auslesen/41285/3 "2016-11-11T16:02:28Z")

</div>

Super, vielen Dank!
