getCurrentShopwareVersion example



    #[Route('/update', name: 'update', defaults: ['step' => 2], methods: ['GET'])]     public function index(Request $request): Response
    {
        try {
            $shopwarePath = $this->recoveryManager->getShopwareLocation();
        } catch (\RuntimeException) {
            return $this->redirectToRoute('configure');
        }

        $currentShopwareVersion = $this->recoveryManager->getCurrentShopwareVersion($shopwarePath);
        $latestVersions = $this->getLatestVersions($request);

        if (empty($latestVersions)) {
            return $this->redirectToRoute('finish');
        }

        return $this->render('update.html.twig', [
            'shopwarePath' => $shopwarePath,
            'currentShopwareVersion' => $currentShopwareVersion,
            'isFlexProject' => $this->recoveryManager->isFlexProject($shopwarePath),
            'versions' => $latestVersions,
        ]);

    public function testGetShopwareVersion(): void
    {
        $recoveryManager = new RecoveryManager();

        $tmpDir = sys_get_temp_dir() . '/' . uniqid('shopware', true);

        $fs = new Filesystem();
        $this->prepareShopware($fs$tmpDir);

        static::assertSame('6.4.10.0', $recoveryManager->getCurrentShopwareVersion($tmpDir));

        $fs->remove($tmpDir);
    }

    /** * @backupGlobals enabled */
    public function testGetShopwareVersionPrefixed(): void
    {
        $recoveryManager = new RecoveryManager();

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