Skip to content

Commit 19f874a

Browse files
authored
Merge branch '5.4-dev' into 53/mod-articles-oncontentPrepare
2 parents 049d7e4 + d4be2a6 commit 19f874a

File tree

1,122 files changed

+20618
-10386
lines changed

Some content is hidden

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

1,122 files changed

+20618
-10386
lines changed

.devcontainer/Dockerfile

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Start from the official PHP 8.2 image with Apache
2+
FROM php:8.2-apache-bookworm
3+
4+
# Install system dependencies, Node.js, Composer, and Cypress dependencies
5+
RUN apt-get update && apt-get install -y \
6+
# System tools and git
7+
git \
8+
unzip \
9+
curl \
10+
sudo \
11+
# PHP extensions dependencies
12+
libpng-dev \
13+
libonig-dev \
14+
libxml2-dev \
15+
libzip-dev \
16+
# MySQL client AND server
17+
default-mysql-client \
18+
default-mysql-server \
19+
# Cypress dependencies
20+
xvfb \
21+
libgtk2.0-0 \
22+
libgtk-3-0 \
23+
libgbm-dev \
24+
libnotify-dev \
25+
libnss3 \
26+
libxss1 \
27+
libasound2 \
28+
libxtst6 \
29+
xauth \
30+
libldap2-dev \
31+
libgd-dev \
32+
&& \
33+
# Install the required PHP extensions for Zip and MySQL
34+
docker-php-ext-install zip mysqli gd ldap && \
35+
# Install Node.js (LTS version)
36+
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
37+
apt-get install -y nodejs && \
38+
# Install Composer globally
39+
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
40+
# Install Xdebug
41+
pecl install xdebug && \
42+
# Clean up apt cache to reduce image size
43+
apt-get clean && rm -rf /var/lib/apt/lists/*
44+
45+
# After installing everything
46+
RUN sed -i 's|/var/www/html|/workspaces/joomla-cms|g' /etc/apache2/sites-available/000-default.conf \
47+
&& sed -i 's|/var/www/html|/workspaces/joomla-cms|g' /etc/apache2/apache2.conf
48+
49+
# Enable Apache's rewrite module and set the ServerName to prevent warnings
50+
RUN a2enmod rewrite \
51+
&& echo "ServerName localhost" >> /etc/apache2/apache2.conf
52+
53+
RUN apt-get update && apt-get install -y ssl-cert && \
54+
a2enmod ssl && \
55+
a2ensite 000-default && \
56+
a2ensite default-ssl && \
57+
sed -i 's|/var/www/html|/workspaces/joomla-cms|g' /etc/apache2/sites-available/default-ssl.conf && \
58+
echo '<Directory /workspaces/joomla-cms>\n Options Indexes FollowSymLinks\n AllowOverride All\n Require all granted\n</Directory>' >> /etc/apache2/sites-available/default-ssl.conf
59+
60+
# Create a custom PHP configuration file to enable file uploads and a log directory
61+
RUN mkdir -p /var/log/ && \
62+
touch /var/log/php_errors.log && \
63+
chown -R www-data:www-data /var/log/ && \
64+
chmod 766 /var/log/php_errors.log && \
65+
echo "upload_tmp_dir = /tmp" > /usr/local/etc/php/conf.d/custom-php.ini && \
66+
echo "post_max_size = 64M" >> /usr/local/etc/php/conf.d/custom-php.ini && \
67+
echo "upload_max_filesize = 64M" >> /usr/local/etc/php/conf.d/custom-php.ini && \
68+
echo "log_errors = On" >> /usr/local/etc/php/conf.d/custom-php.ini && \
69+
echo "error_log = /var/log/php_errors.log" >> /usr/local/etc/php/conf.d/custom-php.ini && \
70+
echo "error_reporting = E_ALL" >> /usr/local/etc/php/conf.d/custom-php.ini

.devcontainer/devcontainer.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "Joomla Dev Environment",
3+
"dockerComposeFile": "docker-compose.yml",
4+
"service": "app",
5+
"workspaceFolder": "/workspaces/joomla-cms",
6+
"features": {
7+
"ghcr.io/devcontainers/features/desktop-lite:1": {}
8+
},
9+
"portsAttributes": {
10+
"443" : {
11+
"label": "Web Server (Joomla & phpmyadmin)",
12+
"onAutoForward": "silent"
13+
},
14+
"6080": {
15+
"label": "Cypress GUI",
16+
"onAutoForward": "silent"
17+
},
18+
"8025": {
19+
"label": "Mailpit Web UI",
20+
"onAutoForward": "openPreview"
21+
}
22+
},
23+
"forwardPorts": [80, 443, 6080, 8025],
24+
"postCreateCommand": "bash ./.devcontainer/post-create.sh",
25+
"customizations": {
26+
"vscode": {
27+
"extensions": [
28+
"xdebug.php-debug",
29+
"bmewburn.vscode-intelephense-client",
30+
"esbenp.prettier-vscode"
31+
],
32+
"settings": {
33+
"launch": {
34+
"version": "0.2.0",
35+
"configurations": [
36+
{
37+
"name": "Listen for Xdebug",
38+
"type": "php",
39+
"request": "launch",
40+
"port": 9003,
41+
"log": false
42+
}
43+
]
44+
}
45+
}
46+
}
47+
},
48+
"remoteUser": "root"
49+
}

.devcontainer/docker-compose.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
services:
2+
app:
3+
build:
4+
context: .
5+
dockerfile: Dockerfile
6+
volumes:
7+
- ..:/workspaces/joomla-cms:cached
8+
- ./xdebug.ini:/usr/local/etc/php/conf.d/99-xdebug.ini
9+
ports:
10+
- "80:80"
11+
- "443:443"
12+
- "3306:3306"
13+
- "6080:6080"
14+
command: sleep infinity
15+
16+
mysql:
17+
image: mysql:8.0
18+
command: --default-authentication-plugin=mysql_native_password
19+
restart: unless-stopped
20+
environment:
21+
MYSQL_ROOT_PASSWORD: root
22+
MYSQL_DATABASE: test_joomla
23+
MYSQL_USER: joomla_ut
24+
MYSQL_PASSWORD: joomla_ut
25+
volumes:
26+
- "mysql-data:/var/lib/mysql"
27+
28+
mailpit:
29+
image: axllent/mailpit:latest
30+
restart: unless-stopped
31+
ports:
32+
- "8025:8025"
33+
34+
volumes:
35+
mysql-data:

.devcontainer/post-create.sh

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
#!/bin/bash
2+
3+
# Exit immediately if a command exits with a non-zero status.
4+
set -e
5+
6+
echo "--- Starting Joomla Core Post-Creation Setup ---"
7+
8+
# Configuration variables
9+
DB_NAME="test_joomla"
10+
DB_USER="joomla_ut"
11+
DB_PASS="joomla_ut"
12+
ADMIN_USER="ci-admin"
13+
ADMIN_REAL_NAME="jane doe"
14+
ADMIN_PASS="joomla-17082005"
15+
ADMIN_EMAIL="[email protected]"
16+
JOOMLA_ROOT="/workspaces/joomla-cms"
17+
18+
# Allow git commands to run safely in the container
19+
git config --global --add safe.directory $JOOMLA_ROOT
20+
21+
# --- 1. Wait for MariaDB Service ---
22+
echo "--> Waiting for MariaDB to become available..."
23+
while ! mysqladmin ping -h"mysql" --silent; do
24+
sleep 1
25+
done
26+
echo "✅ MariaDB is ready."
27+
28+
# --- 2. Install Core Dependencies ---
29+
echo "--> Installing Composer and NPM dependencies..."
30+
composer install
31+
npm install
32+
echo "✅ Dependencies installed."
33+
34+
# --- 3. Install Joomla from Repository Source ---
35+
echo "--> Installing Joomla using the local repository source..."
36+
rm -f configuration.php
37+
php installation/joomla.php install \
38+
--site-name="Joomla CMS Test" \
39+
--admin-user="$ADMIN_REAL_NAME" \
40+
--admin-username="$ADMIN_USER" \
41+
--admin-password="$ADMIN_PASS" \
42+
--admin-email="$ADMIN_EMAIL" \
43+
--db-type="mysqli" \
44+
--db-host="mysql" \
45+
--db-name="$DB_NAME" \
46+
--db-user="$DB_USER" \
47+
--db-pass="$DB_PASS" \
48+
--db-prefix="jos_" \
49+
--db-encryption="0" \
50+
--public-folder=""
51+
echo "✅ Joomla installed."
52+
53+
# --- 4. Configure Joomla for Development ---
54+
echo "--> Applying development settings..."
55+
# Enable debug mode and maximum error reporting for easier troubleshooting.
56+
php cli/joomla.php config:set error_reporting=maximum
57+
# Configure mail settings for Mailpit
58+
php cli/joomla.php config:set mailer=smtp
59+
php cli/joomla.php config:set smtphost=mailpit
60+
php cli/joomla.php config:set smtpport=1025
61+
php cli/joomla.php config:set smtpauth=0
62+
php cli/joomla.php config:set smtpsecure=none
63+
echo "✅ Development settings applied."
64+
65+
# --- 5. Install and Configure phpMyAdmin ---
66+
PMA_ROOT="${JOOMLA_ROOT}/phpmyadmin"
67+
echo "--> Downloading phpMyAdmin into $PMA_ROOT..."
68+
PMA_VERSION=5.2.2
69+
mkdir -p $PMA_ROOT
70+
curl -o /tmp/phpmyadmin.tar.gz https://files.phpmyadmin.net/phpMyAdmin/${PMA_VERSION}/phpMyAdmin-${PMA_VERSION}-all-languages.tar.gz
71+
tar xf /tmp/phpmyadmin.tar.gz --strip-components=1 -C $PMA_ROOT
72+
rm /tmp/phpmyadmin.tar.gz
73+
cp $PMA_ROOT/config.sample.inc.php $PMA_ROOT/config.inc.php
74+
sed -i "/\['AllowNoPassword'\] = false/a \$cfg['Servers'][\$i]['host'] = 'mysql';" $PMA_ROOT/config.inc.php
75+
76+
# --- 6. Apply Codespaces Host Fix ---
77+
# This ensures Joomla generates correct URLs when accessed through the forwarded port.
78+
echo "--> Applying Codespaces URL fix..."
79+
cat > "${JOOMLA_ROOT}/fix.php" << 'EOF'
80+
<?php
81+
// Fix for incorrect host when running behind the Codespaces reverse proxy.
82+
if (isset($_SERVER['HTTP_HOST']) && str_contains($_SERVER['HTTP_HOST'], 'localhost')) {
83+
if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
84+
$_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST'];
85+
$_SERVER['SERVER_NAME'] = $_SERVER['HTTP_X_FORWARDED_HOST'];
86+
}
87+
}
88+
EOF
89+
90+
# Include fix in both entry points
91+
sed -i '2i require_once __DIR__ . "/fix.php";' $JOOMLA_ROOT/index.php
92+
sed -i '2i require_once __DIR__ . "/../fix.php";' $JOOMLA_ROOT/administrator/index.php
93+
94+
echo "--> Ignoring local changes..."
95+
# For TRACKED files, tell Git to stop watching them for changes
96+
git update-index --assume-unchanged "index.php"
97+
git update-index --assume-unchanged "administrator/index.php"
98+
git update-index --assume-unchanged "package-lock.json"
99+
git update-index --assume-unchanged "tests/System/integration/install/Installation.cy.js"
100+
git update-index --assume-unchanged "tests/System/support/commands/config.mjs"
101+
102+
# For NEW UNTRACKED files, add them to the local exclude file
103+
echo "cypress.config.js" >> ".git/info/exclude"
104+
echo "fix.php" >> ".git/info/exclude"
105+
echo "phpmyadmin" >> ".git/info/exclude"
106+
echo "codespace-details.txt" >> ".git/info/exclude"
107+
108+
# --- 7. Finalize Permissions and Testing Tools ---
109+
echo "--> Setting up file permissions and Cypress..."
110+
sed -i \
111+
-e "/\/\/ If exists, delete PHP configuration file to force a new installation/d" \
112+
-e "/cy.task('deleteRelativePath', 'configuration.php');/d" \
113+
-e "/cy.installJoomla(config);/d" \
114+
tests/System/integration/install/Installation.cy.js
115+
sed -i "s/return cy.task('writeRelativeFile', { path: 'configuration.php', content });/return cy.task('writeRelativeFile', { path: 'configuration.php', content, mode: 0o775 });/" tests/System/support/commands/config.mjs
116+
117+
# Ensure Cypress is executable and owned by the web server user
118+
chmod +x ./node_modules/.bin/cypress
119+
cp cypress.config.dist.mjs cypress.config.js
120+
npx cypress install
121+
sed -i -e "s|baseUrl:.*|baseUrl: 'https://localhost',|" -e "s/db_host: 'localhost'/db_host: 'mysql'/g" -e "s/db_user: 'root'/db_user: 'joomla_ut'/g" -e "s/db_password: ''/db_password: 'joomla_ut'/g" cypress.config.js
122+
123+
# Restart Apache to apply all changes
124+
echo '<Directory /workspaces/joomla-cms>
125+
AllowOverride All
126+
Require all granted
127+
</Directory>' | sudo tee -a /etc/apache2/apache2.conf
128+
service apache2 restart
129+
130+
# Set the group to www-data and enforce group permissions
131+
echo "--> Applying final group ownership and permissions..."
132+
chgrp -R www-data $JOOMLA_ROOT
133+
chmod -R g+rws $JOOMLA_ROOT
134+
135+
echo "✅ Environment finalized."
136+
137+
# --- 8. Display Setup Details ---
138+
# Save the details to a file for easy reference.
139+
DETAILS_FILE="${JOOMLA_ROOT}/codespace-details.txt"
140+
{
141+
echo ""
142+
echo "---"
143+
echo "🚀 Joomla Core development environment is ready! 🚀"
144+
echo ""
145+
echo "This information has been saved to codespace-details.txt"
146+
echo ""
147+
echo "Joomla Admin Login:"
148+
echo " URL: Open the 'Ports' tab, find the 'Web Server' (443), and click the Globe icon. Then add /administrator"
149+
echo " Username: $ADMIN_USER"
150+
echo " Password: $ADMIN_PASS"
151+
echo ""
152+
echo "phpMyAdmin Login:"
153+
echo " URL: Open the 'Web Server' port and add /phpmyadmin"
154+
echo " Username: $DB_USER"
155+
echo " Password: $DB_PASS"
156+
echo ""
157+
echo "Mailpit (Email Testing):"
158+
echo " URL: Open the 'Ports' tab, find 'Mailpit Web UI' (8025), and click the Globe icon"
159+
echo " All emails sent by Joomla will appear here for testing"
160+
echo ""
161+
echo "Cypress E2E Testing:"
162+
echo " Run interactive tests: npx cypress open"
163+
echo " Run headless tests: npx cypress run"
164+
echo ""
165+
echo "Xdebug for PHP Debugging:"
166+
echo " Xdebug is pre-configured on port 9003. Use the 'Run and Debug' panel in VS Code and select 'Listen for Xdebug'."
167+
echo "---"
168+
} | tee "$DETAILS_FILE"

.devcontainer/xdebug.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[xdebug]
2+
zend_extension=xdebug
3+
xdebug.mode=debug
4+
xdebug.log_level = 0
5+
xdebug.start_with_request=yes
6+
xdebug.client_port=9003
7+
xdebug.client_host=localhost

.github/CODEOWNERS

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ plugins/finder/* @hackwar
99
build/build.php @rdeutz
1010
build/bump.php @rdeutz
1111
build/deleted_file_check.php @rdeutz
12+
.drone.yml @rdeutz @hackwar
1213

1314
# Core/Extension Install/Update Tools
1415
administrator/components/com_joomlaupdate/* @rdeutz
@@ -19,9 +20,7 @@ libraries/src/Updater/* @rdeutz
1920
.github/workflows/ci.yml @rdeutz @hackwar @laoneo
2021
tests/* @hackwar @laoneo
2122
tests/Unit/* @rdeutz @laoneo
22-
.drone.yml @rdeutz @hackwar @laoneo
2323
phpunit.xml.dist @rdeutz @hackwar @laoneo
24-
phpunit-pgsql.xml.dist @rdeutz @hackwar @laoneo
2524
phpunit-windows.xml.dist @rdeutz @hackwar @laoneo
2625

2726
# Workflow

.github/CONTRIBUTING.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@ You are welcome to submit a contribution for review and possible inclusion in th
1515
Please be patient as not all items will be viewed or tested immediately (remember, all bug testing for the Joomla! CMS is done by volunteers) and be receptive to feedback about your code.
1616

1717
#### Branches
18-
While 4.4 is in maintenance mode, ie we are still fixing bugs, PRs should be made to the `4.4-dev` branch. Merged bugfixes will be upmerged into the current 5.x branch. If a bug is only in the 5.x series the PR should be made to the current 5.x branch (currently 5.1).
18+
Bug fixing PRs should be made to the `5.4-dev` branch. Merged bugfixes will be upmerged into the current branches. New features that do not break backwards compatibility should be made to the `6.1-dev`.
1919

2020

21-
| Branch | Purpose |
22-
| ------ | ------- |
23-
| 4.4-dev | Branch for the current 4.x Joomla version. Currently in maintenance mode |
24-
| 5.1-dev | Branch for the current 5.x Joomla version. Bugfix only for 5.x go into this branch. |
25-
| 5.2-dev | Branch for the next minor 5.x Joomla version. New features go into this branch. |
26-
| 6.0-dev | Branch for the next major Joomla version. New features that include a b/c break have to go into this branch. |
27-
21+
| Branch | Purpose |
22+
|---------|-----------------------------------------------------------------------------------------|
23+
| 5.4-dev | Branch for the current 5.x Joomla version. |
24+
| 6.0-dev | Branch for the current 6.x Joomla version. Bugfixes only for 6.x go into this branch. |
25+
| 6.1-dev | Branch for the next minor 6.x Joomla version. New features have to go into this branch. |

.github/ISSUE_TEMPLATE.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)