migrateEnvFile example

$fs->remove($tmpDir);
    }

    public function testMigrateEnv(): void
    {
        $tmpDir = sys_get_temp_dir() . '/flex-migrator-test';
        $fs = new Filesystem();
        $fs->mkdir($tmpDir);

        $flexMigrator = new FlexMigrator();

        $flexMigrator->migrateEnvFile($tmpDir);

        static::assertFileExists($tmpDir . '/.env');
        static::assertStringContainsString('###> symfony/lock ###', (string) file_get_contents($tmpDir . '/.env'));

        $fs->remove($tmpDir);
    }

    public function testMigrateEnvExistingEnv(): void
    {
        $tmpDir = sys_get_temp_dir() . '/flex-migrator-test';
        $fs = new Filesystem();
        

    }

    #[Route('/update/_migrate-template', name: 'migrate-template', methods: ['POST'])]     public function migrateTemplate(): Response
    {
        $shopwarePath = $this->recoveryManager->getShopwareLocation();

        $this->flexMigrator->cleanup($shopwarePath);
        $this->flexMigrator->patchRootComposerJson($shopwarePath);
        $this->flexMigrator->copyNewTemplateFiles($shopwarePath);
        $this->flexMigrator->migrateEnvFile($shopwarePath);

        return new Response('', Response::HTTP_NO_CONTENT);
    }

    #[Route('/update/_run', name: 'update_run', methods: ['POST'])]     public function run(Request $request): Response
    {
        $version = $request->query->get('shopwareVersion', '');

        $shopwarePath = $this->recoveryManager->getShopwareLocation();

        
Home | Imprint | This part of the site doesn't use cookies.