Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
9c784e9
Cakephp 5 (+ php 8.4, phpunit 11) + BEdita v6-alpha (#1237)
didoda Oct 27, 2025
ba76bd6
chore feat: update release branches
didoda Oct 27, 2025
c3d5f01
Merge branch 'master' into 6.x
didoda Oct 27, 2025
b764e06
chore fix: phpcs
didoda Oct 27, 2025
ceb8bb5
chore fix: phpstan
didoda Oct 27, 2025
6c6297b
fix: variable type
didoda Oct 27, 2025
af50aa0
fix: BulkControllerTest
didoda Oct 27, 2025
68901ae
chore feat: update .gitignore
didoda Oct 27, 2025
88c848d
tests: fix BulkControllerTest
didoda Oct 27, 2025
6c8a770
fix: phpunit warning for testMinimalObjectsList
didoda Oct 27, 2025
ae589ae
Sass migration (#1299)
didoda Oct 27, 2025
a916ff6
Merge branch 'master' into 6.x
didoda Oct 28, 2025
2c93df1
chore fix: phpunit coverage
didoda Oct 28, 2025
fa57d86
fix: HistoryControllerTest
didoda Oct 28, 2025
a4c7117
feat: update Dockerfile
didoda Oct 28, 2025
90c57ea
Mail preview and send (#1320)
didoda Oct 29, 2025
ec6f728
fix: tests
didoda Oct 30, 2025
8e24fd5
Merge branch 'master' into 6.x
didoda Oct 30, 2025
f904463
fix: use object-form class in view forms
didoda Nov 6, 2025
5323e64
chore fix: warning in docker build
didoda Nov 6, 2025
7e21e78
fix: add .dockerignore
didoda Nov 6, 2025
3993292
chore: update dockerignore
batopa Nov 6, 2025
58c0db0
feat: clear cache button in sidebar
didoda Nov 14, 2025
ab75648
Revert "feat: clear cache button in sidebar"
didoda Nov 14, 2025
fa78d64
Merge branch 'master' into 6.x
didoda Nov 17, 2025
2dde151
Merge branch 'master' into 6.x
didoda Nov 18, 2025
b23a712
chore fix: setup module
didoda Nov 19, 2025
b3abce0
Merge branch 'master' into 6.x
didoda Nov 20, 2025
6fd3661
fix: bedita_version 6
didoda Nov 24, 2025
52c8e46
Merge branch 'master' into 6.x
didoda Nov 24, 2025
4687f17
fix: import after use in scss
didoda Nov 25, 2025
f37d3c5
chore fix: update actions checkout to version 6
didoda Dec 1, 2025
2218a6e
fix: scss extend
didoda Dec 12, 2025
49944be
feat: unset module translations if no translatable fields for types
didoda Dec 16, 2025
2d324ba
feat: docker multistage
didoda Dec 17, 2025
5d77a68
chore fix: object-info fields as array
didoda Dec 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.git
.github
.phpunit.cache
.phpunit.result.cache
.vscode
coverage
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

steps:
- name: Checkout current revision
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ jobs:
cs:
uses: bedita/github-workflows/.github/workflows/php-cs.yml@v2
with:
php_versions: '["8.3"]'
php_versions: '["8.4"]'

psalm:
uses: bedita/github-workflows/.github/workflows/php-psalm.yml@v2
with:
php_versions: '["8.3"]'
php_versions: '["8.4"]'

stan:
uses: bedita/github-workflows/.github/workflows/php-stan.yml@v2
with:
php_versions: '["8.3"]'
php_versions: '["8.4"]'

unit-5:
uses: bedita/github-workflows/.github/workflows/php-unit.yml@v2
Expand All @@ -46,6 +46,6 @@ jobs:
unit-6:
uses: bedita/github-workflows/.github/workflows/php-unit.yml@v2
with:
php_versions: '["8.3"]'
php_versions: '["8.4"]'
bedita_version: '6'
coverage_min_percentage: 98
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: bedita/github-workflows/.github/workflows/release.yml@v2
with:
main_branch: 'master'
dist_branches: '["master", "4.x"]'
dist_branches: '["master", "4.x", "5.x"]'
version_bump: ${{ inputs.releaseType }}
version_ini_path: config/version.ini
version_ini_prefix: "[Manager]\nversion="
Expand All @@ -32,7 +32,7 @@ jobs:
steps:

- name: Checkout Code
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Debug output version
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,4 @@ bundle-report.*.html
/webroot/js/*.js
/webroot/js/vendors
/webroot/manifest.json
.phpunit.cache/test-results
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ build:
analysis:
environment:
php:
version: 8.3.3
version: 8.3.16
tests:
override:
- php-scrutinizer-run
111 changes: 82 additions & 29 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,46 +1,99 @@
ARG PHP_VERSION=8.3
FROM chialab/php:${PHP_VERSION}-apache
# syntax=docker/dockerfile:1

# Install Wait-for-it and configure PHP
RUN curl -o /wait-for-it.sh https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh \
&& chmod +x /wait-for-it.sh \
&& echo "[PHP]\noutput_buffering = 4096\nmemory_limit = -1" > /usr/local/etc/php/php.ini
ARG PHP_VERSION=8.4
ARG NODE_VERSION=24.10.0
ARG YARN_VERSION=1.22.22

FROM node:${NODE_VERSION}-alpine AS node

###
### Base runtime image (kept small): PHP-FPM + nginx + required PHP extensions.
###
FROM php:${PHP_VERSION}-fpm-alpine AS runtime-base

RUN apk add --no-cache \
nginx \
curl \
icu-libs \
libpng \
libjpeg-turbo \
freetype \
libzip \
&& apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
icu-dev \
libpng-dev \
libjpeg-turbo-dev \
freetype-dev \
libzip-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) intl gd zip \
&& apk del .build-deps \
&& mkdir -p /run/nginx

# Copy files
COPY . /var/www/html

# Set APP_NAME to avoid .env load
ENV APP_NAME BE-MANAGER
ENV APP_NAME=BE-MANAGER
ARG DEBUG
ENV DEBUG ${DEBUG:-false}
ENV DEBUG=${DEBUG:-false}

# Install libraries
WORKDIR /var/www/html

###
### Builder image: installs git + node/yarn + composer and produces vendor + built assets.
###
FROM runtime-base AS build

RUN apk add --no-cache git

COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer

# Bring in a recent Node.js (pinned) only for the build stage
COPY --from=node /usr/local /usr/local
RUN node -v && npm -v

RUN rm -f /usr/local/bin/yarn /usr/local/bin/yarnpkg \
&& corepack enable \
&& corepack prepare yarn@${YARN_VERSION} --activate \
&& yarn -v

# Build assets (includes plugin assets via yarn install:plugins)
RUN yarn install --frozen-lockfile \
&& yarn build \
&& yarn cache clean

# Composer deps (merge-plugin includes plugins/*/composer.json) + cleanup
RUN git config --global --add safe.directory /var/www/html \
&& composer install --no-dev --prefer-dist --no-interaction --optimize-autoloader \
&& rm -rf /root/.composer/cache

RUN rm -rf /var/www/html/node_modules /var/www/html/config/.env

RUN chown -R www-data:www-data /var/www/html
USER www-data:www-data

RUN if [ ! "$DEBUG" = "true" ]; then export COMPOSER_ARGS='--no-dev'; fi \
&& composer install $COMPOSER_ARGS --optimize-autoloader --no-interaction --quiet
###
### Final runtime image: copy only built artifacts from builder.
###
FROM runtime-base AS runtime

COPY --from=build /var/www/html /var/www/html

# Docker nginx + PHP-FPM configuration
COPY deploy/docker/nginx.conf /etc/nginx/http.d/default.conf
COPY deploy/docker/www.conf /usr/local/etc/php-fpm.d/www.conf

# Restore user `root` to install node & yarn and to make sure we can bind to address 0.0.0.0:80
USER root:root
# App configuration
COPY deploy/docker/app_local.php /var/www/html/config/app_local.php

# Install node and yarn
ENV NODE_VERSION=22.11.0
RUN apt install -y curl
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
ENV NVM_DIR=/root/.nvm
RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION}
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}"
RUN npm install -g yarn
RUN yarn && yarn build
# Entrypoint
COPY deploy/docker/docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh

ENV LOG_DEBUG_URL="console:///?stream=php://stdout" \
LOG_ERROR_URL="console:///?stream=php://stderr"
EXPOSE 80

HEALTHCHECK --interval=30s --timeout=3s --start-period=1m \
CMD curl -f http://localhost/login || exit 1
HEALTHCHECK --interval=120s --timeout=5s --retries=3 CMD curl --fail http://login || exit 1

CMD ["apache2-foreground"]
ENTRYPOINT ["/docker-entrypoint.sh"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Github Actions Javascript](https://github.com/bedita/manager/workflows/javascript/badge.svg)](https://github.com/bedita/manager/actions?query=workflow%3Ajavascript)
[![codecov](https://codecov.io/gh/bedita/manager/branch/master/graph/badge.svg)](https://codecov.io/gh/bedita/manager)
[![phpstan](https://img.shields.io/badge/PHPStan-level%205-brightgreen.svg)](https://phpstan.org)
[![psalm](https://img.shields.io/badge/psalm-level%208-brightgreen.svg)](https://psalm.dev)
[![psalm](https://img.shields.io/badge/psalm-level%207-brightgreen.svg)](https://psalm.dev)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/bedita/manager/badges/quality-score.png)](https://scrutinizer-ci.com/g/bedita/manager/)
[![Version](https://img.shields.io/packagist/v/bedita/manager.svg?label=stable)](https://packagist.org/packages/bedita/manager)
[![License](https://img.shields.io/badge/License-LGPL_v3-orange.svg)](https://github.com/bedita/manager/blob/master/LICENSE.LGPL)
Expand Down
31 changes: 16 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
],
"require": {
"php": ">=8.3",
"bedita/i18n": "^5.1.0",
"bedita/web-tools": "^5.4.0",
"cakephp/authentication": "^2.9",
"cakephp/cakephp": "~4.5.0",
"bedita/i18n": "^6.0.0",
"bedita/web-tools": "^6.0.0",
"cakephp/authentication": "^3.0.3",
"cakephp/cakephp": "^5.0",
"cakephp/plugin-installer": "^1.3",
"josegonzalez/dotenv": "^4.0",
"league/flysystem": "^3.16",
Expand All @@ -37,17 +37,17 @@
"wikimedia/composer-merge-plugin": "^2.0.1"
},
"require-dev": {
"cakephp/bake": "^2.6",
"cakephp/cakephp-codesniffer": "~4.7.0",
"cakephp/console": "^4.4",
"cakephp/debug_kit": "^4.7.1",
"cakephp/repl": "^0.1",
"dereuromark/cakephp-ide-helper": "~1.17.0",
"phpstan/extension-installer": "^1.2",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpunit/phpunit": "^9.6",
"vimeo/psalm": "^5.18"
"cakephp/bake": "^3.2",
"cakephp/cakephp-codesniffer": "^5.0",
"cakephp/console": "^5.0",
"cakephp/debug_kit": "^5.0",
"cakephp/repl": "^2.0",
"dereuromark/cakephp-ide-helper": "^2.6",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^1.12",
"phpstan/phpstan-deprecation-rules": "^1.2",
"phpunit/phpunit": "^11.1.3",
"vimeo/psalm": "^6.8"
},
"autoload": {
"psr-4": {
Expand All @@ -68,6 +68,7 @@
"@test",
"@cs-check"
],
"psalm": "vendor/bin/psalm",
"stan": "vendor/bin/phpstan analyse",
"cs-check": "vendor/bin/phpcs",
"cs-fix": "vendor/bin/phpcbf",
Expand Down
8 changes: 4 additions & 4 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@
* Duration will be set to '+2 minutes' in bootstrap.php when debug = true
* If you set 'className' => 'Null' core cache will be disabled.
*/
'_cake_core_' => [
'_cake_translations_' => [
'className' => FileEngine::class,
'prefix' => 'manager_cake_core_',
'prefix' => 'manager_cake_translations_',
'path' => CACHE . 'persistent/',
'serialize' => true,
'duration' => '+1 years',
Expand Down Expand Up @@ -263,15 +263,15 @@
'path' => LOGS,
'file' => 'debug',
'url' => env('LOG_DEBUG_URL', null),
'scopes' => false,
'scopes' => null,
'levels' => ['notice', 'info', 'debug'],
],
'error' => [
'className' => FileLog::class,
'path' => LOGS,
'file' => 'error',
'url' => env('LOG_ERROR_URL', null),
'scopes' => false,
'scopes' => null,
'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'],
],
],
Expand Down
14 changes: 9 additions & 5 deletions config/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
*/
require CORE_PATH . 'config' . DS . 'bootstrap.php';

require CAKE . 'functions.php';

use Cake\Cache\Cache;
use Cake\Core\Configure;
use Cake\Core\Configure\Engine\IniConfig;
Expand All @@ -39,6 +41,8 @@
use Cake\Log\Log;
use Cake\Routing\Router;
use Cake\Utility\Security;
use Detection\MobileDetect;
use josegonzalez\Dotenv\Loader;

/*
* See https://github.com/josegonzalez/php-dotenv for API details.
Expand All @@ -55,7 +59,7 @@
* for more information for recommended practices.
*/
if (!env('APP_NAME') && file_exists(CONFIG . '.env')) {
$dotenv = new \josegonzalez\Dotenv\Loader([CONFIG . '.env']);
$dotenv = new Loader([CONFIG . '.env']);
$dotenv->parse()
->putenv()
->toEnv()
Expand Down Expand Up @@ -94,7 +98,7 @@
Configure::config('ini', new IniConfig());
Configure::load('version', 'ini');
Configure::load('bedita-api-version', 'ini');
} catch (\Exception $e) {
} catch (Exception $e) {
exit($e->getMessage() . "\n");
}

Expand All @@ -112,7 +116,7 @@
*/
if (Configure::read('debug')) {
Configure::write('Cache._cake_model_.duration', '+2 minutes');
Configure::write('Cache._cake_core_.duration', '+2 minutes');
Configure::write('Cache._cake_translations_.duration', '+2 minutes');
Configure::write('Cache._schema_types_.duration', '+2 minutes');
Configure::write('Cache._project_config_.duration', '+2 minutes');
Configure::write('Cache._thumbs_.duration', '+2 minutes');
Expand Down Expand Up @@ -191,12 +195,12 @@
* and the mobiledetect package from composer.json.
*/
ServerRequest::addDetector('mobile', function ($request) {
$detector = new \Detection\MobileDetect();
$detector = new MobileDetect();

return $detector->isMobile();
});
ServerRequest::addDetector('tablet', function ($request) {
$detector = new \Detection\MobileDetect();
$detector = new MobileDetect();

return $detector->isTablet();
});
Expand Down
16 changes: 12 additions & 4 deletions config/paths.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
/**
* The full path to the directory which holds "src", WITHOUT a trailing DS.
*/
define('ROOT', dirname(__DIR__));
if (!defined('ROOT')) {
define('ROOT', dirname(__DIR__));
}

/**
* The actual directory name for the application directory. Normally
Expand Down Expand Up @@ -85,10 +87,16 @@
*
* CakePHP should always be installed with composer, so look there.
*/
define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'vendor' . DS . 'cakephp' . DS . 'cakephp');
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'vendor' . DS . 'cakephp' . DS . 'cakephp');
}

/**
* Path to the cake directory.
*/
define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
define('CAKE', CORE_PATH . 'src' . DS);
if (!defined('CORE_PATH')) {
define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
}
if (!defined('CAKE')) {
define('CAKE', CORE_PATH . 'src' . DS);
}
Loading
Loading