-
Notifications
You must be signed in to change notification settings - Fork 641
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e6a1a25
commit 5ccd5ff
Showing
3 changed files
with
59 additions
and
2 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
44 changes: 44 additions & 0 deletions
44
src/migrations/m181213_102500_remove_absolue_paths_from_configmap.php
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,44 @@ | ||
<?php | ||
|
||
namespace craft\migrations; | ||
|
||
use Craft; | ||
use craft\db\Migration; | ||
use craft\db\Query; | ||
use craft\helpers\ArrayHelper; | ||
use craft\services\Sections; | ||
use yii\helpers\Json; | ||
|
||
/** | ||
* m181213_102500_remove_absolue_paths_from_configmap migration. | ||
*/ | ||
class m181213_102500_remove_absolue_paths_from_configmap extends Migration | ||
{ | ||
/** | ||
* @inheritdoc | ||
*/ | ||
public function safeUp() | ||
{ | ||
$info = Craft::$app->getInfo(); | ||
$configMap = Json::decode($info->configMap) ?? []; | ||
|
||
foreach ($configMap as &$filePath) { | ||
$filePath = Craft::alias($filePath); | ||
} | ||
|
||
$info->configMap = $configMap; | ||
|
||
Craft::$app->saveInfo($info); | ||
|
||
return true; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function safeDown() | ||
{ | ||
echo "m181213_102500_remove_absolue_paths_from_configmap cannot be reverted.\n"; | ||
return false; | ||
} | ||
} |
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