forked from magento/ece-tools
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MCLOUD-7098: Validation which compare service versions and magento ve…
…rsion doesn't work on PRO (#6)
- Loading branch information
Showing
14 changed files
with
698 additions
and
268 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
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,93 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\MagentoCloud\DB\Data; | ||
|
||
use Magento\MagentoCloud\Config\Environment; | ||
|
||
/** | ||
* Returns database service configurations. | ||
*/ | ||
class ConnectionTypes | ||
{ | ||
const RELATIONSHIP_KEY = 'database'; | ||
const RELATIONSHIP_SLAVE_KEY = 'database-slave'; | ||
|
||
const RELATIONSHIP_QUOTE_KEY = 'database-quote'; | ||
const RELATIONSHIP_QUOTE_SLAVE_KEY = 'database-quote-slave'; | ||
|
||
const RELATIONSHIP_SALES_KEY = 'database-sales'; | ||
const RELATIONSHIP_SALES_SLAVE_KEY = 'database-sales-slave'; | ||
|
||
/** | ||
* @var Environment | ||
*/ | ||
private $environment; | ||
|
||
/** | ||
* @param Environment $environment | ||
*/ | ||
public function __construct( | ||
Environment $environment | ||
) { | ||
$this->environment = $environment; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getConfiguration(): array | ||
{ | ||
return $this->environment->getRelationship(self::RELATIONSHIP_KEY)[0] ?? []; | ||
} | ||
|
||
/** | ||
* Returns service configuration for slave. | ||
* | ||
* @return array | ||
*/ | ||
public function getSlaveConfiguration(): array | ||
{ | ||
return $this->environment->getRelationship(self::RELATIONSHIP_SLAVE_KEY)[0] ?? []; | ||
} | ||
|
||
/** | ||
* Returns configuration for quote service. | ||
*/ | ||
public function getQuoteConfiguration(): array | ||
{ | ||
return $this->environment->getRelationship(self::RELATIONSHIP_QUOTE_KEY)[0] ?? []; | ||
} | ||
|
||
/** | ||
* Returns configuration for quote slave service. | ||
* | ||
* @return array | ||
*/ | ||
public function getQuoteSlaveConfiguration(): array | ||
{ | ||
return $this->environment->getRelationship(self::RELATIONSHIP_QUOTE_SLAVE_KEY)[0] ?? []; | ||
} | ||
|
||
/** | ||
* Returns configuration for sales service. | ||
*/ | ||
public function getSalesConfiguration(): array | ||
{ | ||
return $this->environment->getRelationship(self::RELATIONSHIP_SALES_KEY)[0] ?? []; | ||
} | ||
|
||
/** | ||
* Returns configuration for slave sales service. | ||
* | ||
* @return array | ||
*/ | ||
public function getSalesSlaveConfiguration(): array | ||
{ | ||
return $this->environment->getRelationship(self::RELATIONSHIP_SALES_SLAVE_KEY)[0] ?? []; | ||
} | ||
} |
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
Oops, something went wrong.