Skip to content

Commit 9a2b367

Browse files
feat: initial commit
0 parents  commit 9a2b367

64 files changed

Lines changed: 15785 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ddev/.setup/scripts/utils.sh

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

.ddev/.setup/templates/index.php

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<?php
2+
$extensionKey = getenv('EXTENSION_NAME');
3+
$typo3AdminUser = getenv('TYPO3_INSTALL_ADMIN_USER');
4+
$typo3AdminPassword = getenv('TYPO3_INSTALL_ADMIN_PASSWORD');
5+
$supportedVersions = explode(' ', getenv('TYPO3_VERSIONS'));
6+
7+
// Check if composer.json exists
8+
$composerJsonPath = __DIR__ . '/../composer.json';
9+
if (file_exists($composerJsonPath)) {
10+
$composerJsonContent = file_get_contents($composerJsonPath);
11+
$composerData = json_decode($composerJsonContent, true);
12+
$description = $composerData['description'];
13+
} else {
14+
$description = 'composer.json file not found. =(';
15+
}
16+
?>
17+
<!DOCTYPE html>
18+
<html lang="en">
19+
<head>
20+
<meta charset="UTF-8">
21+
<title><?php echo $extensionKey; ?></title>
22+
<link
23+
rel="stylesheet"
24+
href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css"
25+
>
26+
<style>
27+
.flex {
28+
display: flex;
29+
gap: 10px;
30+
}
31+
</style>
32+
</head>
33+
<body>
34+
<header class="container">
35+
<h1>
36+
<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>
37+
<?php echo $extensionKey; ?></h1>
38+
</header>
39+
<main class="container">
40+
<blockquote><?php echo $description; ?></blockquote>
41+
<hr/>
42+
<p>Run <code>ddev install all</code> to install all TYPO3 instances below:</p>
43+
<?php
44+
foreach ($supportedVersions as $version) {
45+
$directoryPath = '/var/www/html/.Build/' . $version;
46+
if (is_dir($directoryPath)) {
47+
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>";
48+
} else {
49+
echo "<article>Version {$version} is not installed. Run <code>ddev install {$version}</code> to install.</article>";
50+
}
51+
}
52+
?>
53+
<h2>Additional information</h2>
54+
<h4>DDEV commands</h4>
55+
<?php
56+
// Directories to scan for DDEV commands
57+
$directories = [
58+
'/var/www/html/.ddev/commands/web',
59+
'/var/www/html/.ddev/commands/host',
60+
];
61+
62+
foreach ($directories as $directory) {
63+
foreach (new DirectoryIterator($directory) as $fileInfo) {
64+
$filePath = $fileInfo->getPathname();
65+
$fileName = $fileInfo->getFilename();
66+
67+
if ($fileName[0] === '.' || $fileInfo->isDir()) {
68+
continue;
69+
}
70+
71+
$fileContent = file($filePath);
72+
if (str_starts_with($fileContent[0], '#!/bin/bash')) {
73+
$description = '';
74+
$usage = '';
75+
$example = '';
76+
77+
foreach ($fileContent as $line) {
78+
if (str_starts_with($line, '## Description:')) {
79+
$description = trim(str_replace('## Description:', '', $line));
80+
} elseif (str_starts_with($line, '## Usage:')) {
81+
$usage = trim(str_replace('## Usage:', '', $line));
82+
} elseif (str_starts_with($line, '## Example:')) {
83+
$example = trim(str_replace('## Example:', '', $line));
84+
}
85+
}
86+
87+
echo "<article><code>ddev $usage</code><br/>$description<br/> <em>Example: $example</em></article>";
88+
}
89+
}
90+
}
91+
?>
92+
<details open>
93+
<summary><h4>TYPO3 Backend Credentials</h4></summary>
94+
<ul>
95+
<li>Username: <code><?php echo $typo3AdminUser; ?></code></li>
96+
<li>Password: <code><?php echo $typo3AdminPassword; ?></code></li>
97+
</ul>
98+
</details>
99+
</main>
100+
101+
</body>
102+
</html>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: typo3-multi-version-extension
2+
repository: jackd248/ddev-typo3-multi-version-extension
3+
version: 0.2.1
4+
install_date: "2025-09-18T10:46:09+02:00"
5+
project_files:
6+
- .setup/scripts/utils.sh
7+
- .setup/templates/index.php
8+
- .setup/Tests/Acceptance/Fixtures/
9+
- apache/10.conf
10+
- apache/20.conf
11+
- commands/host/launch
12+
- commands/web/.install-11
13+
- commands/web/.install-12
14+
- commands/web/.install-13
15+
- commands/web/11
16+
- commands/web/12
17+
- commands/web/13
18+
- commands/web/all
19+
- commands/web/install
20+
- docker-compose.typo3-setup.yaml
21+
global_files: []
22+
removal_actions:
23+
- rm ${DDEV_APPROOT}/.ddev/config.typo3-setup.yaml
24+
- rm -f ${DDEV_APPROOT}/.ddev/.setup/

.ddev/apache/10.conf

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#ddev-generated
2+
# If you want to take over this file and customize it, remove the line above
3+
# and ddev will respect it and won't overwrite the file.
4+
# See https://ddev.readthedocs.io/en/stable/users/extend/customization-extendibility/#custom-apache-configuration
5+
<VirtualHost *:80>
6+
ServerName typo3-login-warning.ddev.site
7+
DocumentRoot /var/www/html/.Build
8+
<Directory "/var/www/html/.Build">
9+
AllowOverride All
10+
Allow from All
11+
</Directory>
12+
13+
RewriteEngine On
14+
RewriteCond %{HTTP:X-Forwarded-Proto} =https
15+
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -d
16+
RewriteRule ^(.+[^/])$ https://%{HTTP_HOST}$1/ [redirect,last]
17+
SetEnvIf X-Forwarded-Proto "https" HTTPS=on
18+
ErrorLog /dev/stdout
19+
CustomLog ${APACHE_LOG_DIR}/access.log combined
20+
Alias "/phpstatus" "/var/www/phpstatus.php"
21+
</VirtualHost>
22+
23+
<VirtualHost *:443>
24+
ServerName typo3-login-warning.ddev.site
25+
DocumentRoot /var/www/html/.Build
26+
<Directory "/var/www/html/.Build">
27+
AllowOverride All
28+
Allow from All
29+
</Directory>
30+
31+
RewriteEngine On
32+
RewriteCond %{HTTP:X-Forwarded-Proto} =https
33+
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -d
34+
RewriteRule ^(.+[^/])$ https://%{HTTP_HOST}$1/ [redirect,last]
35+
SetEnvIf X-Forwarded-Proto "https" HTTPS=on
36+
ErrorLog /dev/stdout
37+
CustomLog ${APACHE_LOG_DIR}/access.log combined
38+
Alias "/phpstatus" "/var/www/phpstatus.php"
39+
40+
SSLEngine on
41+
SSLCertificateFile /etc/ssl/certs/master.crt
42+
SSLCertificateKeyFile /etc/ssl/certs/master.key
43+
</VirtualHost>

.ddev/apache/20.conf

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#ddev-generated
2+
# If you want to take over this file and customize it, remove the line above
3+
# and ddev will respect it and won't overwrite the file.
4+
# See https://ddev.readthedocs.io/en/stable/users/extend/customization-extendibility/#custom-apache-configuration
5+
<VirtualHost *:80>
6+
ServerName sub.typo3-login-warning.ddev.site
7+
ServerAlias *.typo3-login-warning.ddev.site
8+
DocumentRoot /var/www/html/.Build
9+
<Directory "/var/www/html/.Build">
10+
AllowOverride All
11+
Allow from All
12+
</Directory>
13+
14+
RewriteEngine On
15+
RewriteCond %{HTTP_HOST} ^([a-z0-9-]+)\.typo3-login-warning\.ddev\.site$
16+
RewriteRule ^(.*)$ /var/www/html/.Build/%1/public/$1 [L]
17+
18+
RewriteCond %{HTTP:X-Forwarded-Proto} =https
19+
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -d
20+
RewriteRule ^(.+[^/])$ https://%{HTTP_HOST}$1/ [redirect,last]
21+
SetEnvIf X-Forwarded-Proto "https" HTTPS=on
22+
ErrorLog /dev/stdout
23+
CustomLog ${APACHE_LOG_DIR}/access.log combined
24+
Alias "/phpstatus" "/var/www/phpstatus.php"
25+
</VirtualHost>
26+
27+
<VirtualHost *:443>
28+
ServerName sub.typo3-login-warning.ddev.site
29+
ServerAlias *.typo3-login-warning.ddev.site
30+
DocumentRoot /var/www/html/.Build
31+
<Directory "/var/www/html/.Build">
32+
AllowOverride All
33+
Allow from All
34+
</Directory>
35+
36+
RewriteEngine On
37+
RewriteCond %{HTTP_HOST} ^([a-z0-9-]+)\.typo3-login-warning\.ddev\.site$
38+
RewriteRule ^(.*)$ /var/www/html/.Build/%1/public/$1 [L]
39+
40+
RewriteCond %{HTTP:X-Forwarded-Proto} =https
41+
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -d
42+
RewriteRule ^(.+[^/])$ https://%{HTTP_HOST}$1/ [redirect,last]
43+
SetEnvIf X-Forwarded-Proto "https" HTTPS=on
44+
ErrorLog /dev/stdout
45+
CustomLog ${APACHE_LOG_DIR}/access.log combined
46+
Alias "/phpstatus" "/var/www/phpstatus.php"
47+
48+
SSLEngine on
49+
SSLCertificateFile /etc/ssl/certs/master.crt
50+
SSLCertificateKeyFile /etc/ssl/certs/master.key
51+
</VirtualHost>

.ddev/commands/web/.install-11

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
## #ddev-generated
4+
. .ddev/.setup/scripts/utils.sh
5+
6+
# Pre-setup function for TYPO3 version 11.
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 11
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/.install-12

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

.ddev/commands/web/.install-13

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

.ddev/commands/web/11

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
## #ddev-generated
4+
## Description: Exec command for TYPO3 instance 11.
5+
## Usage: 11
6+
## Example: "ddev 11 composer du -o" or "ddev 11 typo3 cache:flush"
7+
8+
. .ddev/.setup/scripts/utils.sh
9+
10+
command=$@
11+
version=11
12+
13+
if [[ $command == typo3* ]]; then
14+
command="/usr/bin/php vendor/bin/typo3cms${command:5}"
15+
fi
16+
17+
TYPO3_PATH=".Build/${version}"
18+
if [ -d "$TYPO3_PATH" ]; then
19+
message magenta "[TYPO3 v${version}] ${command}"
20+
cd $TYPO3_PATH
21+
$command
22+
else
23+
message red "TYPO3 binary not found for version ${version}"
24+
fi

.ddev/commands/web/12

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
## Description: Exec command for TYPO3 instance 12.
4+
## Usage: 12
5+
## Example: "ddev 12 composer du -o" or "ddev 12 typo3 cache:flush"
6+
7+
. .ddev/.setup/scripts/utils.sh
8+
9+
command=$@
10+
version=12
11+
12+
if [[ $command == typo3* ]]; then
13+
command="/usr/bin/php vendor/bin/${command}"
14+
fi
15+
16+
TYPO3_PATH=".Build/${version}"
17+
if [ -d "$TYPO3_PATH" ]; then
18+
message magenta "[TYPO3 v${version}] ${command}"
19+
cd $TYPO3_PATH
20+
$command
21+
else
22+
message red "TYPO3 binary not found for version ${version}"
23+
fi

0 commit comments

Comments
 (0)