Pimcore\Update::installComposerJson PHP Method

installComposerJson() public static method

public static installComposerJson ( $newFile, $oldFile )
$newFile
$oldFile
    public static function installComposerJson($newFile, $oldFile)
    {
        $existingContents = file_get_contents($oldFile);
        $newContents = file_get_contents($newFile);
        $existingContents = json_decode($existingContents, true);
        $newContents = json_decode($newContents, true);
        if ($existingContents && $newContents) {
            $mergeResult = array_replace_recursive($existingContents, $newContents);
            $newJson = json_encode($mergeResult);
            $newJson = \Pimcore\Helper\JsonFormatter::format($newJson, true, true);
            File::put($oldFile, $newJson);
        }
    }