-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MOL-1071: fix service loading problem on Shopware 5.3 and lower
- Loading branch information
1 parent
3ac08f5
commit 0e11f51
Showing
3 changed files
with
69 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace MollieShopware\Components\Services; | ||
|
||
use Shopware\Components\DependencyInjection\Container as DIContainer; | ||
|
||
class ShopwareVersionService | ||
{ | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $shopwareVersion; | ||
|
||
|
||
/** | ||
* @param DIContainer $container | ||
*/ | ||
public function __construct($container) | ||
{ | ||
$releaseKey = 'shopware.release.version'; | ||
|
||
if ($container->hasParameter($releaseKey)) { | ||
$this->shopwareVersion = (string)$container->getParameter($releaseKey); | ||
} else { | ||
# coming with v5.3 as far as I know | ||
# we need it only for checks > 5.7.x, so I guess that should be fine | ||
$this->shopwareVersion = '5.3'; | ||
} | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getShopwareVersion() | ||
{ | ||
return $this->shopwareVersion; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters