Skip to content

Commit 2ced5f9

Browse files
committed
Prepare Phalcon 5.14.2 baseline
1 parent 84151f3 commit 2ced5f9

15 files changed

Lines changed: 559 additions & 78 deletions

File tree

.github/workflows/main.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ on:
1919

2020
env:
2121
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
22-
PHALCON_VERSION: 5.14.1
23-
PHALCON_PECL_URL: https://github.com/phalcon/cphalcon/releases/download/v5.14.1/phalcon-pecl.tgz
22+
PHALCON_VERSION: 5.14.2
23+
PHALCON_PECL_URL: https://github.com/phalcon/cphalcon/releases/download/v5.14.2/phalcon-pecl.tgz
2424
# PHP extensions required by Composer
2525
EXTENSIONS: apcu, gettext, gd, igbinary, imagick, intl, json, mbstring, msgpack, memcached, sqlite3, yaml, redis, openssl, swoole, :memcache, :psr
26-
EXTENSIONS_CACHE_KEY: php-ext-v4-php8.5-phalcon-helper-5.14.1
26+
EXTENSIONS_CACHE_KEY: php-ext-v4-php8.5-phalcon-helper-5.14.2
2727

2828
permissions:
2929
contents: read
@@ -67,7 +67,7 @@ jobs:
6767
extensions: ${{ env.EXTENSIONS }}
6868
tools: composer
6969

70-
- name: Ensure Phalcon 5.14.1
70+
- name: Ensure Phalcon 5.14.2
7171
run: bash .github/scripts/install-phalcon.sh
7272

7373
- uses: ramsey/composer-install@v4
@@ -119,7 +119,7 @@ jobs:
119119
extensions: ${{ env.EXTENSIONS }}
120120
tools: composer, phpcs
121121

122-
- name: Ensure Phalcon 5.14.1
122+
- name: Ensure Phalcon 5.14.2
123123
run: bash .github/scripts/install-phalcon.sh
124124

125125
- uses: ramsey/composer-install@v4
@@ -168,7 +168,7 @@ jobs:
168168
extensions: ${{ env.EXTENSIONS }}
169169
tools: composer, phpstan
170170

171-
- name: Ensure Phalcon 5.14.1
171+
- name: Ensure Phalcon 5.14.2
172172
run: bash .github/scripts/install-phalcon.sh
173173

174174
- uses: ramsey/composer-install@v4
@@ -222,7 +222,7 @@ jobs:
222222
extensions: ${{ env.EXTENSIONS }}
223223
tools: composer, psalm
224224

225-
- name: Ensure Phalcon 5.14.1
225+
- name: Ensure Phalcon 5.14.2
226226
run: bash .github/scripts/install-phalcon.sh
227227

228228
- uses: ramsey/composer-install@v4
@@ -322,7 +322,7 @@ jobs:
322322
extensions: ${{ env.EXTENSIONS }}
323323
tools: composer, phpunit
324324

325-
- name: Ensure Phalcon 5.14.1
325+
- name: Ensure Phalcon 5.14.2
326326
run: bash .github/scripts/install-phalcon.sh
327327

328328
- uses: ramsey/composer-install@v4

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,30 @@ history, the old changelog, and committed file changes. Older Zemit-era entries
1515
are summarized where the commit history is too granular to be useful as
1616
release notes.
1717

18+
## 3.1.5 - Unreleased
19+
20+
### Added
21+
22+
- Added a Phalcon runtime upgrade guide covering extension, Composer, IDE stub,
23+
Docker, CI, and application compatibility checks for patch-level Phalcon
24+
upgrades.
25+
26+
### Changed
27+
28+
- Prepared the package and CI baseline for Phalcon 5.14.2 by raising the
29+
`ext-phalcon` and `phalcon/ide-stubs` floors and updating the GitHub Actions
30+
Phalcon install pin.
31+
32+
### Fixed
33+
34+
- Restored JSON body parameter support for REST body requests without merging
35+
query, form, or alternate-method body parameters into the save payload.
36+
- Updated PhalconKit custom validators to use Phalcon 5.14.2's consolidated
37+
`allowEmpty` handling, including per-field maps.
38+
- Kept the Blameable audit-table guard from treating an unavailable database
39+
connection as a missing audit table, preserving fake/no-database audit
40+
behavior while still skipping known missing audit tables.
41+
1842
## 3.1.4 - 2026-06-16
1943

2044
### Changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ services, transformers, and tasks remain application-owned.
160160
## Requirements
161161

162162
- PHP `>= 8.5`
163-
- Phalcon `^5.14.1`
163+
- Phalcon `^5.14.2`
164164
- Composer
165165
- A PDO-compatible database supported by Phalcon
166166
- MySQL 8+ for the core test/scaffold baseline
@@ -179,6 +179,7 @@ IMAP, sockets, SimpleXML, and GD.
179179
- Add roles and row-level access: [Identity And Permissions](guides/identity-and-permissions.md)
180180
- Deploy behind PHP-FPM or WebSocket proxying: [Web Server And WebSocket](guides/web-server-and-websocket.md)
181181
- Run checks before release: [Quality And Maintenance](guides/quality-and-maintenance.md)
182+
- Upgrade the Phalcon extension: [Phalcon Runtime Upgrades](guides/phalcon-runtime-upgrades.md)
182183
- Use the bundled AI skills: [AI-Assisted Development](AI.md)
183184
- Migrate from the old package name: [Migration From zemit-cms/core](guides/migration-from-zemit.md)
184185
- Migrate old RESTful resources: [Migrate RESTful 0.x Resources To 1.x](guides/migration-restful-0x-to-1x.md)

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"ext-json": "*",
6969
"ext-mbstring": "*",
7070
"ext-pdo": "*",
71-
"ext-phalcon": "^5.14.1",
71+
"ext-phalcon": "^5.14.2",
7272
"ext-sodium": "*",
7373
"docopt/docopt": "^1.0.6",
7474
"league/flysystem": "^3.34.0",
@@ -100,7 +100,7 @@
100100
"league/oauth2-instagram": "^3.1.0",
101101
"league/oauth2-linkedin": "^5.1.2",
102102
"openai-php/client": "^0.19.0",
103-
"phalcon/ide-stubs": "^5.14.1",
103+
"phalcon/ide-stubs": "^5.14.2",
104104
"php-imap/php-imap": "^6.0",
105105
"saggre/phpdocumentor-markdown": "^1.0.0",
106106
"shuchkin/simplexlsxgen": "^1.5.17",
@@ -133,7 +133,7 @@
133133
"league/oauth2-instagram": "^3.1.0",
134134
"league/oauth2-linkedin": "^5.1.2",
135135
"openai-php/client": "^0.19.0",
136-
"phalcon/ide-stubs": "^5.14.1",
136+
"phalcon/ide-stubs": "^5.14.2",
137137
"php-imap/php-imap": "^6.0",
138138
"saggre/phpdocumentor-markdown": "^1.0.0",
139139
"shuchkin/simplexlsxgen": "^1.5.17",

guides/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,16 @@ with Phalcon Kit. Start with the task you are trying to complete.
3636
and WebSocket worker proxying.
3737
2. [Quality And Maintenance](quality-and-maintenance.md): local QA commands and
3838
CI expectations.
39-
3. [Project Roadmap](../ROADMAP.md): release blocks, priorities, retired
39+
3. [Phalcon Runtime Upgrades](phalcon-runtime-upgrades.md): update the native
40+
extension, Composer platform requirement, IDE stubs, Docker images, and CI
41+
pins together.
42+
4. [Project Roadmap](../ROADMAP.md): release blocks, priorities, retired
4043
GitHub Project items, and maintainer planning rules.
41-
4. [Testing Strategy](testing-roadmap.md): phased unit, component,
44+
5. [Testing Strategy](testing-roadmap.md): phased unit, component,
4245
integration, model, eager-loading, and REST API coverage approach.
43-
5. [To Be Discussed](to-be-discussed.md): open maintainer design questions that
46+
6. [To Be Discussed](to-be-discussed.md): open maintainer design questions that
4447
need a concrete use case before behavior changes.
45-
6. [Release Process](release.md): release checklist and package-history notes.
48+
7. [Release Process](release.md): release checklist and package-history notes.
4649

4750
## I Am Using zemit-cms/core
4851

guides/phalcon-runtime-upgrades.md

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# Phalcon Runtime Upgrades
2+
3+
Use this guide when moving a PhalconKit application or the core package to a
4+
new native Phalcon patch or minor release.
5+
6+
This is separate from the `zemit-cms/core` package rename and the old RESTful
7+
resource migration. Runtime upgrades are mostly dependency, extension,
8+
static-analysis, CI, and compatibility-review work.
9+
10+
## When To Use This
11+
12+
Use this checklist when changing any of these values:
13+
14+
- the installed `phalcon` PHP extension;
15+
- the Composer `ext-phalcon` platform requirement;
16+
- `phalcon/ide-stubs`;
17+
- Docker `PHALCON_VERSION` build arguments;
18+
- CI Phalcon install URLs or extension cache keys.
19+
20+
Keep those changes in one focused commit where possible. Avoid mixing a runtime
21+
upgrade with unrelated model, controller, schema, or API behavior changes.
22+
23+
## Phalcon 5.14.2 Checklist
24+
25+
For the 5.14.2 line, align the package and runtime on:
26+
27+
```json
28+
{
29+
"require": {
30+
"ext-phalcon": "^5.14.2"
31+
},
32+
"require-dev": {
33+
"phalcon/ide-stubs": "^5.14.2"
34+
}
35+
}
36+
```
37+
38+
Applications that keep `phalcon/ide-stubs` only under `suggest` or in a
39+
separate development tooling package should still update the same version floor
40+
there so IDE and analyzer signatures match the installed extension.
41+
42+
## Local Runtime
43+
44+
Install the native extension first, then verify the CLI PHP runtime that
45+
Composer and QA tools will use:
46+
47+
```shell
48+
php -r 'echo phpversion("phalcon") ?: "not installed"; echo PHP_EOL;'
49+
php --ri phalcon
50+
composer check-platform-reqs
51+
```
52+
53+
If a machine has multiple PHP binaries, run those checks with the same binary
54+
used by Composer, PHP-FPM, Swoole workers, and CLI tasks. Do not rely on web
55+
server PHP and CLI PHP having the same extension version unless both are
56+
checked.
57+
58+
## Composer And Stubs
59+
60+
For PhalconKit core, update tracked Composer constraints and leave ignored
61+
local lock/vendor changes out of the release commit unless the repository
62+
explicitly tracks them.
63+
64+
For applications that track `composer.lock`, update the lock file too:
65+
66+
```shell
67+
composer update phalcon/ide-stubs phalcon-kit/core --with-dependencies
68+
composer check-platform-reqs
69+
```
70+
71+
When preparing Composer metadata before the new extension is installed, the
72+
temporary lock refresh can ignore only the not-yet-installed platform
73+
requirements:
74+
75+
```shell
76+
composer update phalcon/ide-stubs --with-dependencies --ignore-platform-req=ext-phalcon
77+
```
78+
79+
Add other `--ignore-platform-req` flags only for extensions that are unrelated
80+
to the upgrade and genuinely absent from the local CLI PHP runtime. Run
81+
`composer check-platform-reqs` again after the real extension is installed.
82+
83+
If the application does not update `phalcon-kit/core` in the same change, still
84+
update `phalcon/ide-stubs` so Psalm, PHPStan, and IDEs analyze against the same
85+
native API version as the runtime.
86+
87+
## Docker And CI
88+
89+
Update every runtime image and CI pin that installs Phalcon:
90+
91+
- Docker `ARG PHALCON_VERSION`;
92+
- GitHub Actions or other CI `PHALCON_VERSION`;
93+
- PECL or GitHub release tarball URLs;
94+
- extension cache keys that include the Phalcon version;
95+
- image tags or build cache keys derived from PHP and Phalcon versions.
96+
97+
After changing CI pins, confirm the install URL resolves before relying on the
98+
workflow. A redirect from the GitHub release asset URL is enough for the
99+
installer used by this repository.
100+
101+
## Application Compatibility Review
102+
103+
Patch-level Phalcon upgrades are usually small, but PhalconKit applications
104+
should review these recurring integration boundaries:
105+
106+
- Replace deprecated `Phalcon\Events\ManagerInterface` and
107+
`Phalcon\Events\EventInterface` references in application-owned contracts with
108+
`Phalcon\Contracts\Events\Manager` and `Phalcon\Contracts\Events\Event`.
109+
- Keep native Phalcon setter boundaries honest. If a native method still
110+
requires a concrete `Phalcon\Events\Manager`, guard or type the value there
111+
instead of passing only a broader contract.
112+
- Keep mailer config canonical and lower-case, especially
113+
`MAILER_SMTP_ENCRYPTION=ssl` or `tls`. PhalconKit normalizes common casing,
114+
but lowercase config keeps app examples and deploy variables unambiguous.
115+
- Validate app config for provider options that become network behavior later,
116+
such as mailer driver, SMTP encryption, host, port, username, and adapter
117+
class names.
118+
- If overriding REST/query policy setters or merge helpers, keep signatures
119+
widened to the current `array|\Phalcon\Support\Collection|null` contracts.
120+
- If using `modelHasColumn()`, keep application PHPDoc aligned with its nullable
121+
model-name contract. The helper returns `false` for missing or invalid model
122+
names instead of requiring a strict `class-string`.
123+
124+
## Validation
125+
126+
Run the smallest useful checks before the extension is installed, then run the
127+
runtime checks after installation.
128+
129+
Before installing the new extension:
130+
131+
```shell
132+
composer validate --strict --no-check-publish
133+
git diff --check
134+
```
135+
136+
After installing the new extension:
137+
138+
```shell
139+
composer check-platform-reqs
140+
composer phpcs
141+
composer psalm
142+
composer psalm:taint
143+
composer phpunit
144+
```
145+
146+
For a public release, run the full release gate from
147+
[Quality And Maintenance](quality-and-maintenance.md) and follow
148+
[Release Process](release.md).

resources/skills/phalconkit-app-developer/references/environment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ same extension setup:
164164
```dockerfile
165165
ARG PHP_VARIANT=php:8.5-fpm
166166
ARG COMPOSER_VARIANT=composer:2
167-
ARG PHALCON_VERSION=5.14.1
167+
ARG PHALCON_VERSION=5.14.2
168168
169169
FROM docker.io/library/${COMPOSER_VARIANT} AS composer
170170
FROM ${PHP_VARIANT}

src/Filter/Validation/Validator/Color.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ class Color extends AbstractValidator implements ValidatorInterface
4141
* Create the color validator.
4242
*
4343
* Common Phalcon validator options such as `message`, `template`, and
44-
* `allowEmpty` are forwarded to the native base validator. The actual color
45-
* check remains strict: when a value reaches `validate()`, it must be a
46-
* string in one of the supported hexadecimal formats.
44+
* `allowEmpty` are forwarded to the native base validator. Native
45+
* empty-value handling, including per-field maps, is honored before the
46+
* strict color check runs.
4747
*
4848
* @param array<string, mixed> $options Native Phalcon validator options.
4949
*/
@@ -65,6 +65,10 @@ public function __construct(array $options = [])
6565
public function validate(Validation $validation, mixed $field): bool
6666
{
6767
$value = $validation->getValue($field);
68+
69+
if (is_string($field) && $this->isAllowEmpty($validation, $field)) {
70+
return true;
71+
}
6872

6973
if (!is_string($value) || !$this->isValidColor($value)) {
7074
$validation->appendMessage(

src/Filter/Validation/Validator/Json.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ class Json extends AbstractValidator implements ValidatorInterface
4343
*
4444
* Supported options:
4545
* - `message`/`template`: native Phalcon message customization.
46-
* - `allowEmpty`: when true, PHP-empty values such as `null` and `''` pass
47-
* before JSON syntax is checked.
46+
* - `allowEmpty`: native Phalcon empty-value handling, including
47+
* per-field maps, is honored before JSON syntax is checked.
4848
* - `depth`: maximum nesting depth passed to `json_validate()`.
4949
* - `flags`: JSON validation flags passed to `json_validate()`.
5050
*
@@ -70,9 +70,7 @@ public function validate(Validation $validation, mixed $field): bool
7070
{
7171
$value = $validation->getValue($field);
7272

73-
$allowEmpty = $this->getOption('allowEmpty', false);
74-
75-
if ($allowEmpty && empty($value)) {
73+
if (is_string($field) && $this->isAllowEmpty($validation, $field)) {
7674
return true;
7775
}
7876

0 commit comments

Comments
 (0)