getShopwareLocation example

$fileName = realpath($_SERVER['SCRIPT_FILENAME']);
        static::assertIsString($fileName);
        static::assertSame(\dirname($fileName)$recoveryManager->getProjectDir());
    }

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

        static::expectException(\RuntimeException::class);
        static::expectExceptionMessage('Could not find Shopware installation');
        $recoveryManager->getShopwareLocation();
    }

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

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

        

    public function __construct(
        private readonly PhpBinaryFinder $binaryFinder,
        private readonly RecoveryManager $recoveryManager
    ) {
    }

    #[Route('/configure', name: 'configure', defaults: ['step' => 1])]     public function index(Request $request): Response
    {
        try {
            $shopwareLocation = $this->recoveryManager->getShopwareLocation();
        } catch (\RuntimeException $e) {
            $shopwareLocation = null;
        }

        if ($phpBinary = $request->request->get('phpBinary')) {
            // Reset the latest version to force a new check             $request->getSession()->remove('latestVersion');

            $request->getSession()->set('phpBinary', $phpBinary);

            return $this->redirectToRoute($shopwareLocation === null ? 'install' : 'update');
        }
private readonly RecoveryManager $recoveryManager,
        private readonly ReleaseInfoProvider $releaseInfoProvider,
        private readonly FlexMigrator $flexMigrator,
        private readonly StreamedCommandResponseGenerator $streamedCommandResponseGenerator
    ) {
    }

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

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