Skip to content

Commit 57518af

Browse files
committed
Merge 5.0 into issue-330
Signed-off-by: alexmerlin <alex.merlin.1985@gmail.com>
2 parents 3f65fc8 + ae621c2 commit 57518af

File tree

23 files changed

+138
-172
lines changed

23 files changed

+138
-172
lines changed

.github/workflows/codecov.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,10 @@ jobs:
4242
php${{ matrix.php }}-composer-
4343
4444
- name: Install dependencies with composer
45+
env:
46+
COMPOSER_DEV_MODE: 1
4547
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
4648

47-
- name: Setup project
48-
run: |
49-
mv config/autoload/local.php.dist config/autoload/local.php
50-
mv config/autoload/mail.local.php.dist config/autoload/mail.local.php
51-
mv config/autoload/local.test.php.dist config/autoload/local.test.php
52-
5349
- name: Collect code coverage with PHPUnit
5450
run: vendor/bin/phpunit --colors=always --coverage-clover clover.xml
5551

.github/workflows/static-analysis.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,5 @@ jobs:
4444
- name: Install dependencies with composer
4545
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
4646

47-
- name: Setup project
48-
run: |
49-
mv config/autoload/local.php.dist config/autoload/local.php
50-
mv config/autoload/mail.local.php.dist config/autoload/mail.local.php
51-
mv config/autoload/local.test.php.dist config/autoload/local.test.php
52-
5347
- name: Run static analysis with PHPStan
5448
run: vendor/bin/phpstan analyse

.laminas-ci/pre-run.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ JOB=$3
22
PHP_VERSION=$4
33
COMMAND=$(echo "${JOB}" | jq -r '.command')
44

5-
echo "Running $COMMAND"
5+
echo "Running pre-run $COMMAND"
66

77
if [[ ${COMMAND} =~ phpunit ]];then
88

99
apt-get install php"${PHP_VERSION}"-sqlite3
1010

1111
cp config/autoload/local.php.dist config/autoload/local.php
12-
cp config/autoload/mail.local.php.dist config/autoload/mail.local.php
1312
cp config/autoload/local.test.php.dist config/autoload/local.test.php
1413

1514
fi

CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
11
# Changelog
22

3+
## 5.3.0 - 2025-01-08
4+
5+
### Changed
6+
7+
* Issue [#352](https://github.com/dotkernel/api/issues/352): Updated PHPStan memory limit by [@bidi47](https://github.com/bidi47) in [#353](https://github.com/dotkernel/api/pull/353)
8+
* Issue [#360](https://github.com/dotkernel/api/issues/360): Restricted `Qodana` to supported PHP versions by [@alexmerlin](https://github.com/alexmerlin) in [#361](https://github.com/dotkernel/api/pull/361)
9+
* Issue [#366](https://github.com/dotkernel/api/issues/366): Updated laminas/laminas-coding-standard to latest version by [@MarioRadu](https://github.com/MarioRadu) in [#367](https://github.com/dotkernel/api/pull/367)
10+
* Issue [#362](https://github.com/dotkernel/api/issues/362): Updated user status, removed isDeleted by [@bidi47](https://github.com/bidi47) in [#359](https://github.com/dotkernel/api/pull/359)
11+
* Issue [#355](https://github.com/dotkernel/api/issues/355): Upgraded to dotkernel/dot-mail 5.0 by [@MarioRadu](https://github.com/MarioRadu) in [#368](https://github.com/dotkernel/api/pull/368)
12+
* Issue [#374](https://github.com/dotkernel/api/issues/374): Updated anonymization by [@bidi47](https://github.com/bidi47) in [#375](https://github.com/dotkernel/api/pull/375)
13+
* Issue [#374](https://github.com/dotkernel/api/issues/372): Ignore development files on production env by [@MarioRadu](https://github.com/MarioRadu) in [#373](https://github.com/dotkernel/api/pull/373)
14+
* Update security.txt file by [@arhimede](https://github.com/arhimede) in [#371](https://github.com/dotkernel/api/pull/371)
15+
16+
### Added
17+
18+
* Issue [#363](https://github.com/dotkernel/api/issues/363): Composer post install script which copies config files by [@MarioRadu](https://github.com/MarioRadu) in [#364](https://github.com/dotkernel/api/pull/364)
19+
20+
### Deprecated
21+
22+
* Nothing
23+
24+
### Removed
25+
26+
* Issue [#354](https://github.com/dotkernel/api/issues/354): Removed laminas/laminas-http dependency by [@MarioRadu](https://github.com/MarioRadu) in [#356](https://github.com/dotkernel/api/pull/356)
27+
* Issue [#362](https://github.com/dotkernel/api/issues/362): Updated user status, removed isDeleted by [@bidi47](https://github.com/bidi47) in [#359](https://github.com/dotkernel/api/pull/359)
28+
* Issue [#369](https://github.com/dotkernel/api/issues/369): Delete `config/autoload/mail.global.php.dist` by [@alexmerlin](https://github.com/alexmerlin) in [#370](https://github.com/dotkernel/api/pull/370)
29+
* Removed composer script `post-create-project-cmd` by [@MarioRadu](https://github.com/MarioRadu) in [#376](https://github.com/dotkernel/api/pull/376)
30+
31+
### Fixed
32+
33+
* Issue [#377](https://github.com/dotkernel/api/issues/377): Fixed `.github/workflows/codecov.yml` by [@alexmerlin](https://github.com/alexmerlin) in [#378](https://github.com/dotkernel/api/pull/378)
34+
335
## 5.2.0 - 2024-11-19
436

537
### Changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
# DotKernel API
22

3-
Based on Enrico Zimuel's [Zend Expressive API - Skeleton example](https://github.com/ezimuel/zend-expressive-api), DotKernel API runs on [Laminas](https://github.com/laminas) and [Mezzio](https://github.com/mezzio) components and implements standards like PSR-3, PSR-4, PSR-7, PSR-11 and PSR-15.
3+
DotKernel API is a PHP skeleton app for building REST APIs using [Laminas](https://github.com/laminas) and [Mezzio](https://github.com/mezzio) components and implements standards like PSR-3, PSR-4, PSR-7, PSR-11 and PSR-15.
4+
5+
Dotkernel API is an alternative for legacy Laminas API Tools (formerly Apigility) applications, and is based on Enrico Zimuel's [Zend Expressive API - Skeleton example](https://github.com/ezimuel/zend-expressive-api).
6+
7+
> Live [demo](https://api.dotkernel.net/).
8+
9+
## Documentation
10+
11+
Documentation is available at: https://docs.dotkernel.org/api-documentation/
12+
13+
## Badges
414

515
![OSS Lifecycle](https://img.shields.io/osslifecycle/dotkernel/api)
616
![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/api/5.2.0)
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
require_once 'vendor/autoload.php';
6+
7+
const ENVIRONMENT_DEVELOPMENT = 'development';
8+
const ENVIRONMENT_PRODUCTION = 'production';
9+
10+
// phpcs:disable PSR1.Files.SideEffects.FoundWithSymbols
11+
12+
function copyFile(array $file): void
13+
{
14+
if (! in_array(getEnvironment(), $file['environment'])) {
15+
echo "Skipping the copy of {$file['source']} due to environment settings." . PHP_EOL;
16+
return;
17+
}
18+
19+
if (is_readable($file['destination'])) {
20+
echo "File {$file['destination']} already exists. Skipping..." . PHP_EOL;
21+
return;
22+
}
23+
24+
if (! copy($file['source'], $file['destination'])) {
25+
echo "Cannot copy {$file['source']} file to {$file['destination']}" . PHP_EOL;
26+
} else {
27+
echo "File {$file['source']} copied successfully to {$file['destination']}." . PHP_EOL;
28+
}
29+
}
30+
31+
function getEnvironment(): string
32+
{
33+
return getenv('COMPOSER_DEV_MODE') === '1' ? ENVIRONMENT_DEVELOPMENT : ENVIRONMENT_PRODUCTION;
34+
}
35+
36+
// when adding files to the below array the `source` and `destination` paths must be relative to the project root folder
37+
// the `environment` key will indicate on what environments the file will be copied,
38+
$files = [
39+
[
40+
'source' => 'config/autoload/local.php.dist',
41+
'destination' => 'config/autoload/local.php',
42+
'environment' => [ENVIRONMENT_DEVELOPMENT, ENVIRONMENT_PRODUCTION],
43+
],
44+
[
45+
'source' => 'config/autoload/local.test.php.dist',
46+
'destination' => 'config/autoload/local.test.php',
47+
'environment' => [ENVIRONMENT_DEVELOPMENT],
48+
],
49+
[
50+
'source' => 'vendor/dotkernel/dot-mail/config/mail.global.php.dist',
51+
'destination' => 'config/autoload/mail.global.php',
52+
'environment' => [ENVIRONMENT_DEVELOPMENT, ENVIRONMENT_PRODUCTION],
53+
],
54+
];
55+
56+
echo "Using environment setting: " . getEnvironment() . PHP_EOL;
57+
58+
array_walk($files, 'copyFile');

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"dotkernel/dot-data-fixtures": "^1.2.2",
5757
"dotkernel/dot-dependency-injection": "^1.0",
5858
"dotkernel/dot-errorhandler": "^4.0.0",
59-
"dotkernel/dot-mail": "^4.1.1",
59+
"dotkernel/dot-mail": "^5.1.0",
6060
"dotkernel/dot-response-header": "^3.2.3",
6161
"laminas/laminas-component-installer": "^3.4.0",
6262
"laminas/laminas-config-aggregator": "^1.14.0",
@@ -78,7 +78,7 @@
7878
"zircote/swagger-php": "^4.10"
7979
},
8080
"require-dev": {
81-
"laminas/laminas-coding-standard": "^2.5",
81+
"laminas/laminas-coding-standard": "^3.0",
8282
"laminas/laminas-development-mode": "^3.12.0",
8383
"mezzio/mezzio-tooling": "^2.9.0",
8484
"phpstan/phpstan": "^2.0",
@@ -105,8 +105,8 @@
105105
}
106106
},
107107
"scripts": {
108-
"post-install-cmd": [
109-
"@development-enable"
108+
"post-update-cmd": [
109+
"php bin/composer-post-install-script.php"
110110
],
111111
"development-disable": "laminas-development-mode disable",
112112
"development-enable": "laminas-development-mode enable",

config/autoload/local.php.dist

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ $databases = [
1919
];
2020

2121
return [
22-
'application' => [
22+
'application' => [
2323
'name' => 'DotKernel API',
2424
'url' => $baseUrl,
2525
'versioning' => [
2626
'documentation_url' => 'https://docs.dotkernel.org/api-documentation/v5/core-features/versioning',
2727
],
2828
],
29-
'authentication' => [
29+
'authentication' => [
3030
'private_key' => [
3131
'key_or_path' => getcwd() . '/data/oauth/private.key',
3232
'key_permissions_check' => false,
@@ -45,18 +45,19 @@ return [
4545
'message' => 'Invalid credentials.',
4646
],
4747
],
48-
'databases' => $databases,
49-
'doctrine' => [
50-
'connection' => [
48+
'databases' => $databases,
49+
'doctrine' => [
50+
'connection' => [
5151
'orm_default' => [
5252
'params' => $databases['default'],
5353
],
5454
],
5555
],
56-
'uploads' => [
56+
'uploads' => [
5757
'user' => [
5858
'url' => $baseUrl . '/uploads/user',
5959
'path' => realpath(__DIR__ . '/../../public/uploads/user'),
6060
],
6161
],
62+
'userAnonymizeAppend' => '',
6263
];

config/autoload/mail.local.php.dist

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

config/config.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
Laminas\Filter\ConfigProvider::class,
2626
Laminas\HttpHandlerRunner\ConfigProvider::class,
2727
Laminas\Hydrator\ConfigProvider::class,
28-
Laminas\Mail\ConfigProvider::class,
2928
Laminas\Validator\ConfigProvider::class,
3029
// Include cache configuration
3130
new Laminas\ConfigAggregator\ArrayProvider($cacheConfig),

0 commit comments

Comments
 (0)