Skip to content

Commit f4b9c7f

Browse files
Merge pull request #49 from xima-media/ddev-multi-version
build(ddev): update multi-version add-on to 0.3.3 and add test fixtures
2 parents fcbc082 + d8c9ba3 commit f4b9c7f

22 files changed

Lines changed: 895 additions & 80 deletions

File tree

.ddev/.setup/scripts/utils.sh

Lines changed: 563 additions & 0 deletions
Large diffs are not rendered by default.

.ddev/.setup/templates/index.php

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
$extensionKey = getenv('EXTENSION_NAME');
5+
$typo3AdminUser = getenv('TYPO3_SETUP_ADMIN_USERNAME');
6+
$typo3AdminPassword = getenv('TYPO3_SETUP_ADMIN_PASSWORD');
7+
$supportedVersions = explode(' ', getenv('TYPO3_VERSIONS'));
8+
9+
// Check if composer.json exists
10+
$composerJsonPath = __DIR__.'/../composer.json';
11+
if (file_exists($composerJsonPath)) {
12+
$composerJsonContent = file_get_contents($composerJsonPath);
13+
$composerData = json_decode($composerJsonContent, true);
14+
$description = $composerData['description'];
15+
} else {
16+
$description = 'composer.json file not found. =(';
17+
}
18+
?>
19+
<!DOCTYPE html>
20+
<html lang="en">
21+
<head>
22+
<meta charset="UTF-8">
23+
<title><?php echo $extensionKey; ?></title>
24+
<link
25+
rel="stylesheet"
26+
href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css"
27+
>
28+
<style>
29+
.flex {
30+
display: flex;
31+
gap: 10px;
32+
}
33+
</style>
34+
</head>
35+
<body>
36+
<header class="container">
37+
<h1>
38+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="-0.5 -0.5 24 24" id="Typo3-Icon--Streamline-Svg-Logos.svg" height="40" width="40"><path fill="#F49700" d="M9.895582291666667 0.5915863541666667c-0.4094479166666667 0.35015104166666666 -0.7003020833333333 0.7595869791666667 -0.7003020833333333 1.9823292708333333 0 3.32738125 4.19994375 13.322414583333334 7.060448958333334 13.322414583333334 0.32128125 0.004360416666666667 0.6412927083333333 -0.04125625 0.9485583333333334 -0.13522083333333335l-0.0060375 0.0016770833333333334 -0.07309687499999999 0.11725208333333334C14.656414583333333 19.815003125000004 11.685221875 22.70162291666667 9.887244791666667 22.759530208333334L9.832571875000001 22.760416666666668C5.927195833333333 22.760416666666668 0.38405927083333335 10.970137500000002 0.38405927083333335 5.7827270833333335c0 -0.8170270833333334 0.185265 -1.45805625 0.46686645833333335 -1.8563635416666668C2.194099375 2.2849110416666667 6.394071875000001 0.9991703125 9.895582291666667 0.5915863541666667ZM15.379429166666668 0.23958333333333334c3.616366666666667 0 7.236446875 0.5835842708333334 7.236446875 2.6252104166666665 0 4.142515625000001 -2.627055208333333 9.1632 -3.9683864583333337 9.1632 -2.391760416666667 0 -5.372680208333334 -6.652869791666666 -5.372680208333334 -9.980222291666667C13.274809375 0.5304494791666666 13.856541666666667 0.23958333333333334 15.373870833333335 0.23958333333333334h0.0055583333333333335Z" stroke-width="1"></path></svg>
39+
<?php echo $extensionKey; ?></h1>
40+
</header>
41+
<main class="container">
42+
<blockquote><?php echo $description; ?></blockquote>
43+
<hr/>
44+
<p>Run <code>ddev install all</code> to install all TYPO3 instances below:</p>
45+
<?php
46+
foreach ($supportedVersions as $version) {
47+
$directoryPath = '/var/www/html/.Build/'.$version;
48+
if (is_dir($directoryPath)) {
49+
echo "<article class='flex'><kbd>{$version}</kbd><div><strong>Frontend</strong><br/><strong>Backend</strong></div><div><a target='_blank' href='https://{$version}.{$extensionKey}.ddev.site'>https://{$version}.{$extensionKey}.ddev.site</a><br/><a target='_blank' href='https://{$version}.{$extensionKey}.ddev.site/typo3/?u={$typo3AdminUser}&p={$typo3AdminPassword}'>https://{$version}.{$extensionKey}.ddev.site/typo3</a></div></article>";
50+
} else {
51+
echo "<article>Version {$version} is not installed. Run <code>ddev install {$version}</code> to install.</article>";
52+
}
53+
}
54+
?>
55+
<h2>Additional information</h2>
56+
<h4>DDEV commands</h4>
57+
<?php
58+
// Directories to scan for DDEV commands
59+
$directories = [
60+
'/var/www/html/.ddev/commands/web',
61+
'/var/www/html/.ddev/commands/host',
62+
];
63+
64+
foreach ($directories as $directory) {
65+
foreach (new DirectoryIterator($directory) as $fileInfo) {
66+
$filePath = $fileInfo->getPathname();
67+
$fileName = $fileInfo->getFilename();
68+
69+
if ('.' === $fileName[0] || $fileInfo->isDir()) {
70+
continue;
71+
}
72+
73+
$fileContent = file($filePath);
74+
if (str_starts_with($fileContent[0], '#!/bin/bash')) {
75+
$description = '';
76+
$usage = '';
77+
$example = '';
78+
79+
foreach ($fileContent as $line) {
80+
if (str_starts_with($line, '## Description:')) {
81+
$description = trim(str_replace('## Description:', '', $line));
82+
} elseif (str_starts_with($line, '## Usage:')) {
83+
$usage = trim(str_replace('## Usage:', '', $line));
84+
} elseif (str_starts_with($line, '## Example:')) {
85+
$example = trim(str_replace('## Example:', '', $line));
86+
}
87+
}
88+
89+
echo "<article><code>ddev $usage</code><br/>$description<br/> <em>Example: $example</em></article>";
90+
}
91+
}
92+
}
93+
?>
94+
<details open>
95+
<summary><h4>TYPO3 Backend Credentials</h4></summary>
96+
<ul>
97+
<li>Username: <code><?php echo $typo3AdminUser; ?></code></li>
98+
<li>Password: <code><?php echo $typo3AdminPassword; ?></code></li>
99+
</ul>
100+
</details>
101+
</main>
102+
103+
</body>
104+
</html>
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
name: typo3-multi-version-extension
22
repository: konradmichalik/ddev-typo3-multi-version-extension
3-
version: 0.1.0
4-
install_date: "2025-07-31T12:02:23+02:00"
3+
version: 0.3.3
4+
install_date: "2026-06-25T15:55:59+02:00"
55
project_files:
6-
- .typo3-setup/scripts/utils.sh
7-
- .typo3-setup/templates/index.php
8-
- .typo3-setup/Tests/.typo3-setup/
6+
- .setup/scripts/utils.sh
7+
- .setup/templates/index.php
8+
- .setup/Tests/Acceptance/Fixtures/
99
- apache/10.conf
1010
- apache/20.conf
1111
- commands/host/launch
1212
- commands/web/.install-11
1313
- commands/web/.install-12
1414
- commands/web/.install-13
15+
- commands/web/.install-14
1516
- commands/web/11
1617
- commands/web/12
1718
- commands/web/13
19+
- commands/web/14
1820
- commands/web/all
1921
- commands/web/install
2022
- docker-compose.typo3-setup.yaml
2123
global_files: []
2224
removal_actions:
23-
- rm ${DDEV_APPROOT}/.ddev/config.typo3-setup.yaml
24-
- rm -f ${DDEV_APPROOT}/.ddev/.typo3-setup/
25-
- rm -rf ${DDEV_APPROOT}/Tests/.typo3-setup/
25+
- rm -f ${DDEV_APPROOT}/.ddev/config.typo3-setup.yaml
26+
- rm -rf ${DDEV_APPROOT}/.ddev/.setup/

.ddev/commands/web/.install-11

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
2+
set -eo pipefail
23

34
## #ddev-generated
4-
. .ddev/.typo3-setup/scripts/utils.sh
5+
. .ddev/.setup/scripts/utils.sh
56

67
# Pre-setup function for TYPO3 version 11.
78
# This function is part of the installation script and is responsible for performing
89
# initial setup tasks before the main installation process begins.
910
pre_setup 11
1011

11-
# Install TYPO3 and related packages using Composer.
12-
# This command installs the TYPO3 base distribution, TYPO3 console, and additional packages.
13-
# Add any additional packages you want to install to the command below.
14-
composer req typo3/cms-base-distribution:'^11.5' \
15-
helhum/typo3-console:'^7.1' \
16-
$PACKAGE_NAME:'*@dev' \
17-
test/sitepackage:'*@dev' \
18-
--no-progress -n -d $BASE_PATH
12+
#_progress " ├─ Install additional composer packages"
13+
# composer req x/y:'^1.0' \
14+
# --no-progress -n -d $BASE_PATH
15+
#_done
1916

2017
# Function to perform post-setup tasks.
2118
# This function is called after the main installation process to finalize the setup.

.ddev/commands/web/.install-12

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
#!/bin/bash
2+
set -eo pipefail
23

3-
## #ddev-generated
4-
. .ddev/.typo3-setup/scripts/utils.sh
4+
. .ddev/.setup/scripts/utils.sh
55

66
# Pre-setup function for TYPO3 version 12.
77
# This function is part of the installation script and is responsible for performing
88
# initial setup tasks before the main installation process begins.
99
pre_setup 12
1010

11-
# Install TYPO3 and related packages using Composer.
12-
# This command installs the TYPO3 base distribution, TYPO3 console, and additional packages.
13-
# Add any additional packages you want to install to the command below.
14-
composer req typo3/cms-base-distribution:'^12.4' \
15-
helhum/typo3-console:'^8.1' \
16-
$PACKAGE_NAME:'*@dev' \
17-
test/sitepackage:'*@dev' \
18-
--no-progress -n -d $BASE_PATH
11+
#_progress " ├─ Install additional composer packages"
12+
# composer req x/y:'^1.0' \
13+
# --no-progress -n -d $BASE_PATH
14+
#_done
1915

2016
# Function to perform post-setup tasks.
2117
# This function is called after the main installation process to finalize the setup.

.ddev/commands/web/.install-13

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
#!/bin/bash
2+
set -eo pipefail
23

3-
## #ddev-generated
4-
. .ddev/.typo3-setup/scripts/utils.sh
4+
. .ddev/.setup/scripts/utils.sh
55

66
# Pre-setup function for TYPO3 version 13.
77
# This function is part of the installation script and is responsible for performing
88
# initial setup tasks before the main installation process begins.
99
pre_setup 13
1010

11-
# Install TYPO3 and related packages using Composer.
12-
# This command installs the TYPO3 base distribution, TYPO3 console, and additional packages.
13-
# Add any additional packages you want to install to the command below.
14-
composer req typo3/cms-base-distribution:'^13.4' \
15-
helhum/typo3-console:'^8.2.1' \
16-
$PACKAGE_NAME:'*@dev' \
17-
test/sitepackage:'*@dev' \
18-
--no-progress -n -d $BASE_PATH
11+
#_progress " ├─ Install additional composer packages"
12+
# composer req x/y:'^1.0' \
13+
# --no-progress -n -d $BASE_PATH
14+
#_done
1915

2016
# Function to perform post-setup tasks.
2117
# This function is called after the main installation process to finalize the setup.

.ddev/commands/web/.install-14

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
set -eo pipefail
3+
4+
. .ddev/.setup/scripts/utils.sh
5+
6+
# Pre-setup function for TYPO3 version 14
7+
# This function is part of the installation script and is responsible for performing
8+
# initial setup tasks before the main installation process begins.
9+
pre_setup 14
10+
11+
#_progress " ├─ Install additional composer packages"
12+
# composer req x/y:'^1.0' \
13+
# --no-progress -n -d $BASE_PATH
14+
#_done
15+
16+
# Function to perform post-setup tasks.
17+
# This function is called after the main installation process to finalize the setup.
18+
# It typically includes tasks such as configuring settings, modifying files, and other necessary adjustments.
19+
post_setup

.ddev/commands/web/11

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
## Usage: 11
66
## Example: "ddev 11 composer du -o" or "ddev 11 typo3 cache:flush"
77

8-
. .ddev/.typo3-setup/scripts/utils.sh
8+
. .ddev/.setup/scripts/utils.sh
99

1010
command=$@
1111
version=11

.ddev/commands/web/12

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
#!/bin/bash
22

3-
## #ddev-generated
43
## Description: Exec command for TYPO3 instance 12.
54
## Usage: 12
65
## Example: "ddev 12 composer du -o" or "ddev 12 typo3 cache:flush"
76

8-
. .ddev/.typo3-setup/scripts/utils.sh
7+
. .ddev/.setup/scripts/utils.sh
98

109
command=$@
1110
version=12

.ddev/commands/web/13

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
#!/bin/bash
22

3-
## #ddev-generated
43
## Description: Exec command for TYPO3 instance 13.
54
## Usage: 13
65
## Example: "ddev 13 composer du -o" or "ddev 13 typo3 cache:flush"
76

8-
. .ddev/.typo3-setup/scripts/utils.sh
7+
. .ddev/.setup/scripts/utils.sh
98

109
command=$@
1110
version=13

0 commit comments

Comments
 (0)