copyNewTemplateFiles example

'versions' => $latestVersions,
        ]);
    }

    #[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();

        
$fs->remove($tmpDir);
    }

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

        $flexMigrator = new FlexMigrator();

        $flexMigrator->copyNewTemplateFiles($tmpDir);

        static::assertFileExists($tmpDir . '/symfony.lock');
        static::assertFileExists($tmpDir . '/bin/console');

        $fs->remove($tmpDir);
    }

    public function testMigrateEnv(): void
    {
        $tmpDir = sys_get_temp_dir() . '/flex-migrator-test';
        $fs = new Filesystem();
        
Home | Imprint | This part of the site doesn't use cookies.