Created
March 27, 2020 10:16
-
-
Save clivewalkden/436559bed9df5ecd6cb0172ac8c9cd80 to your computer and use it in GitHub Desktop.
UB Migrate Data Pro
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
Index: magento/app/code/Ubertheme/Ubdatamigration/Block/Index.php | |
IDEA additional info: | |
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
<+>UTF-8 | |
=================================================================== | |
--- magento/app/code/Ubertheme/Ubdatamigration/Block/Index.php (date 1585223427069) | |
+++ magento/app/code/Ubertheme/Ubdatamigration/Block/Index.php (date 1585223427069) | |
@@ -70,11 +70,17 @@ | |
public function getToken() { | |
$token = ''; | |
$configPath = $this->_fileSystem->getDirectoryRead(\Magento\Framework\App\Filesystem\DirectoryList::CONFIG)->getAbsolutePath(); | |
- $configFilePath = "{$configPath}env.php"; | |
+ $envFilePath = "{$configPath}env.php"; | |
+ if (file_exists($envFilePath)) { | |
+ $envData = require $envFilePath; | |
+ } | |
+ | |
+ $configFilePath = "{$configPath}config.php"; | |
if (file_exists($configFilePath)) { | |
- $envData = require $configFilePath; | |
- $token = md5($envData['backend']['frontName'] . ":" . $envData['crypt']['key'] . ":" . $envData['install']['date']); | |
+ $configData = require $configFilePath; | |
} | |
+ | |
+ $token = md5($envData['backend']['frontName'] . ":" . $configData['crypt']['key'] . ":" . $envData['install']['date']); | |
return $token; | |
} |
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
Index: magento/pub/ub-tool/protected/models/UBMigrate.php | |
IDEA additional info: | |
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
<+>UTF-8 | |
=================================================================== | |
--- magento/pub/ub-tool/protected/models/UBMigrate.php (date 1585231272218) | |
+++ magento/pub/ub-tool/protected/models/UBMigrate.php (date 1585231272218) | |
@@ -112,13 +112,19 @@ | |
public static function getEnvData() | |
{ | |
- $data = []; | |
- $configFile = Yii::app()->basePath . "/../../../app/etc/env.php"; | |
+ $envData = []; | |
+ $configData = []; | |
+ $envFile = Yii::app()->basePath . "/../../../app/etc/env.php"; | |
+ if (file_exists($envFile)) { | |
+ $envData = require $envFile; | |
+ } | |
+ | |
+ $configFile = Yii::app()->basePath . "/../../../app/etc/config.php"; | |
if (file_exists($configFile)) { | |
- $data = require $configFile; | |
+ $configData = require $configFile; | |
} | |
- return $data; | |
+ return array_merge($envData, $configData); | |
} | |
public static function getToken() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment