Skip to content

Commit 3625609

Browse files
authored
Merge pull request #10609 from codeigniter4/develop
4.7.5 Ready code
2 parents 2bd0f01 + 43372fc commit 3625609

563 files changed

Lines changed: 11631 additions & 12541 deletions

File tree

Some content is hidden

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

‎.gitattributes‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ utils/ export-ignore
2222
.php-cs-fixer.no-header.php export-ignore
2323
.php-cs-fixer.tests.php export-ignore
2424
.php-cs-fixer.user-guide.php export-ignore
25+
structarmed-baseline.php export-ignore
2526
structarmed.php export-ignore
2627
phpmetrics.json export-ignore
2728
phpstan-baseline.php export-ignore
@@ -32,6 +33,7 @@ psalm-baseline.xml export-ignore
3233
psalm.xml export-ignore
3334
psalm_autoload.php export-ignore
3435
rector.php export-ignore
36+
AGENTS.md export-ignore
3537

3638
# source user guide
3739
user_guide_src/ export-ignore

‎.github/carson.yml‎

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# https://github.com/NexusPHP/carson/blob/1.x/SUBSCRIBERS.md
2+
3+
version: 1
4+
subscribers:
5+
- auto-labeler
6+
- conflicts-notifier
7+
- no-merge-commits
8+
- no-response-closer
9+
- pr-title-linter
10+
- signed-commits
11+
- template-enforcer
12+
- welcome
13+
settings:
14+
auto-labeler:
15+
sync_labels: true
16+
sync_exempt:
17+
- enhancement
18+
rules:
19+
- label: '4.8' # @todo change value whenever the next minor version is changed
20+
base_branch: ['^4\.8$']
21+
- label: github_actions
22+
files: ['.github/workflows/*']
23+
- label: documentation
24+
files:
25+
all: ['user_guide_src/source/**']
26+
- label: testing
27+
files:
28+
all: ['tests/**']
29+
- label: bug
30+
title: ['^fix(\([^)]*\))?: ']
31+
- label: enhancement
32+
title: ['^perf(\([^)]*\))?: ']
33+
- label: refactor
34+
title: ['^refactor(\([^)]*\))?: ']
35+
conflicts-notifier:
36+
label: stale
37+
message: |-
38+
:wave: Hi, @{{user}}!
39+
40+
We detected conflicts in your PR against the base branch :speak_no_evil:
41+
You may want to sync :arrows_counterclockwise: your branch with upstream!
42+
43+
Ref: [Syncing Your Branch](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/workflow.md#updating-your-branch)
44+
no-merge-commits:
45+
name: 'Carson / no-merge-commits'
46+
treat_merge_commits_as: failure
47+
exempt_branches:
48+
- head: '^develop$'
49+
base: '^master$'
50+
- head: '^4\.\d+$'
51+
base: '^develop$'
52+
no-response-closer:
53+
rules:
54+
- label: needs template
55+
only: issues
56+
days_until_close: 2
57+
close_message: |-
58+
Closing this issue: the description still does not follow the bug report template after {{days_until_close}} days.
59+
60+
Please open a new issue using the [bug report form](https://github.com/codeigniter4/CodeIgniter4/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml&title=Bug%3A+). For feature requests or support questions, please use the [forums](https://forum.codeigniter.com/forum-30.html).
61+
- label: waiting for info
62+
days_until_close: 14
63+
unlabel_on_response: true
64+
close_message: |-
65+
Closing this {{type}}: there has been no response for {{days_until_close}} days after more information was requested.
66+
67+
If you can provide the requested details, leave a comment and a maintainer can reopen it.
68+
pr-title-linter:
69+
name: 'Carson / pr-title-linter'
70+
rules:
71+
- pattern: '^(?:(?:\[\d+\.\d+\] )?(?:feat|fix|chore|docs|perf|refactor|style|test|config|revert)(?:\([\-.@:`a-zA-Z0-9]+\))?!?: \S.+\S|Prep for \d+\.\d+\.\d+ release|\d+\.\d+\.\d+ (?:Ready|Merge) code)$'
72+
description: 'PR title must include the type (feat, fix, chore, docs, perf, refactor, style, test, config, revert) of the commit per Conventional Commits specification. See https://www.conventionalcommits.org/en/v1.0.0/ for the discussion.'
73+
level: error
74+
signed-commits:
75+
name: 'Carson / signed-commits'
76+
treat_unsigned_as: failure
77+
template-enforcer:
78+
label: needs template
79+
exempt_roles: [admin, maintain, write, triage]
80+
message: |-
81+
Hi there, @{{user}}! :wave:
82+
83+
It looks like this {{type}} does not follow our template:
84+
85+
{{violations}}
86+
87+
Please update the description to follow the template. The `{{label}}` label will be removed automatically once it does.
88+
issues:
89+
rules:
90+
- pattern: '### PHP Version[\s\S]*### CodeIgniter4 Version'
91+
description: 'Use the [bug report form](https://github.com/codeigniter4/CodeIgniter4/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml&title=Bug%3A+), which asks for your PHP and CodeIgniter4 versions. For a feature request or support question, please use the [forums](https://forum.codeigniter.com/forum-30.html).'
92+
pull_requests:
93+
rules:
94+
- pattern: '\*\*Description\*\*'
95+
description: 'Keep the **Description** heading from the [pull request template](https://github.com/codeigniter4/CodeIgniter4/blob/develop/.github/PULL_REQUEST_TEMPLATE.md) and explain what you have changed, and why.'
96+
- pattern: '\*\*Checklist:?\*\*'
97+
description: 'Keep the **Checklist** from the pull request template and tick the items that apply. See [what we expect in a pull request](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md).'
98+
- pattern: 'Explain what you have changed, and why\.'
99+
description: 'Replace the placeholder text under **Description** with your own explanation.'
100+
mode: forbid
101+
welcome:
102+
first_time:
103+
pull_request: |-
104+
Hi there, @{{user}}! :wave:
105+
106+
Thank you for sending this PR!
107+
108+
We expect the following in all Pull Requests (PRs).
109+
- PRs must be sent to the [appropriate branch](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#branching)
110+
- All git commits must be [GPG-signed](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#signing)
111+
- Must follow our [style guide](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#php-style)
112+
- Be [commented](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#comments) in the PHP source file
113+
- Be documented in the [user guide](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#user-guide)
114+
- Be [unit tested](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#unit-testing)
115+
- Pass all checks in GitHub Actions
116+
117+
> [!IMPORTANT]
118+
> We expect all code changes or bug-fixes to be accompanied by one or more tests added to our test suite to prove the code works.
119+
120+
If pull requests do not comply with the above, they will likely be closed. Since we are a team of volunteers, we don't have any more time to work
121+
on the framework than you do. Please make it as painless for your contributions to be included as possible.
122+
123+
See https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md
124+
issue: false
125+
returning: false

‎.github/copilot-instructions.md‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copilot Code Review Instructions
2+
3+
Repository-wide conventions, the target-branch compatibility policy, coding
4+
standards, and FrankenPHP Worker Mode requirements are defined in the root
5+
`AGENTS.md`. Apply that policy in every review; this file covers review
6+
behavior only.
7+
8+
## Review priorities
9+
10+
Prioritize actionable findings involving:
11+
12+
- incorrect behavior or an unhandled edge case;
13+
- backward compatibility;
14+
- security, input validation, and context-appropriate output escaping;
15+
- request-specific state leaking through globals, static properties, or
16+
shared services, including under Worker Mode where one process serves
17+
many requests;
18+
- differences between supported database drivers (MySQLi, PostgreSQL,
19+
SQLite3, SQLSRV, OCI8);
20+
- missing regression tests, user-guide changes, changelog entries, or
21+
upgrade instructions.
22+
23+
## Review behavior
24+
25+
- Determine the PR base branch and apply the compatibility policy from
26+
`AGENTS.md`. If the base branch cannot be determined, assume `develop`
27+
and state that assumption.
28+
- Do not report formatting-only issues already enforced by PHP-CS-Fixer.
29+
- Every finding should identify a concrete failure scenario and the
30+
affected code.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
applyTo: "system/Database/**/*.php,tests/system/Database/**/*.php"
3+
---
4+
5+
# Database layer
6+
7+
- Consider all supported drivers: MySQLi, PostgreSQL, SQLite3, SQLSRV, and
8+
OCI8.
9+
- Check identifier quoting, value binding, `NULL` behavior, transactions,
10+
affected rows, return types, and platform-specific SQL.
11+
- Do not implement driver-independent behavior in only one driver.
12+
- When changing a base database class, inspect driver overrides and their
13+
method signatures.
14+
- Keep driver-independent tests separate from tests that require a live
15+
database.
16+
- Use the `DatabaseLive` PHPUnit group only when a real database connection is
17+
required.
18+
- Prefer focused tests for the affected base class and drivers. Leave the full
19+
multi-driver matrix to GitHub Actions.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
applyTo: "system/**/*.php"
3+
---
4+
5+
# Framework core
6+
7+
- Assume public and protected symbols are extension points used by third-party
8+
applications unless they are clearly marked internal.
9+
- Apply the target-branch compatibility policy from the root `AGENTS.md`
10+
before changing any extension point.
11+
- Before changing a signature or behavior, inspect parent classes, implemented
12+
interfaces, traits, service factories, configuration, and corresponding
13+
tests.
14+
- Keep file paths, class names, and namespaces aligned under `CodeIgniter\`.
15+
- Preserve existing extension and dependency-injection points.
16+
- Consider long-running worker environments. Do not retain request-specific
17+
state in static properties, globals, or shared services after a request
18+
finishes.
19+
- Avoid introducing a framework-wide abstraction to solve a single local
20+
problem.
21+
- On `develop`, keep exceptions and observable side effects compatible. On a
22+
`4.*` target, change them only as an explicit, narrow, documented breaking
23+
enhancement with a migration path.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
applyTo: "tests/**/*.php"
3+
---
4+
5+
# PHPUnit tests
6+
7+
- Mirror the corresponding `system/` component and local test conventions
8+
where practical.
9+
- Add the appropriate PHPUnit `Group` attribute described in
10+
`tests/README.md`.
11+
- Prefer `assertSame()` and dedicated assertions over loose or generic
12+
assertions.
13+
- Cover the regression or behavior through a public API where possible.
14+
Avoid testing private implementation details.
15+
- Restore services, factories, environment variables, superglobals, handlers,
16+
locale, time-related state, and other global state modified by a test.
17+
- Tests must not depend on execution order or state left by another test.
18+
- Do not replace a meaningful assertion with a weaker assertion to make a test
19+
pass.
20+
- After changing behavior, run the smallest relevant test file or component.
21+
Do not run the complete test suite by default.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
applyTo: "user_guide_src/**/*.rst"
3+
---
4+
5+
# User guide
6+
7+
- Preserve the existing reStructuredText structure, terminology, directives,
8+
anchors, and surrounding writing style.
9+
- Keep PHP examples compatible with PHP 8.2 and verify signatures and behavior
10+
against the current framework code.
11+
- Distinguish new behavior from existing behavior and document defaults
12+
precisely.
13+
- Determine the PR target branch before describing compatibility:
14+
`develop` follows the patch-release policy, while `4.*` follows the
15+
minor-release policy in the root `AGENTS.md`.
16+
- Behavior changes, enhancements, deprecations, and important bug fixes may
17+
require a changelog entry.
18+
- Changes requiring users to modify code or configuration may require an
19+
upgrading-guide entry.
20+
- For an intentional compatibility break targeting `4.*`, document the old
21+
behavior, new behavior, affected users, reason for the change, and the
22+
smallest migration in both the minor changelog and upgrading guide.
23+
- Keep code examples minimal but complete enough to run in a normal
24+
CodeIgniter application.
25+
- Leave the complete Sphinx build and documentation validation to GitHub
26+
Actions unless the task specifically requires local documentation
27+
validation.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
applyTo: "system/Boot.php,system/CodeIgniter.php,system/Commands/Worker/**,system/Config/BaseService.php,system/Config/Factories.php,system/Config/Factory.php,system/Config/Services.php,system/Database/Config.php,system/Database/BaseConnection.php,system/Database/ConnectionInterface.php,system/Database/*/Connection.php,system/Events/Events.php,system/Session/**,system/Cache/**,system/HTTP/**,system/Filters/**,system/Router/**,system/Security/**,system/Debug/Toolbar.php,system/Debug/Toolbar/**,app/Config/WorkerMode.php,tests/system/Commands/Worker/**,user_guide_src/source/installation/worker_mode.rst"
3+
---
4+
5+
# FrankenPHP Worker Mode
6+
7+
Use `system/Commands/Worker/Views/frankenphp-worker.php.tpl` as the canonical
8+
Worker Mode entry point. `worker:install` publishes this template to
9+
`public/frankenphp-worker.php`.
10+
11+
When changing bootstrap or request-lifecycle code, trace all three Worker Mode
12+
phases:
13+
14+
1. One-time process bootstrap through `Boot::bootWorker()`.
15+
2. Per-request preparation: reconnect database and cache connections, reset
16+
the `CodeIgniter` instance, and replace all request superglobals before
17+
calling `$app->run()`.
18+
3. Post-request cleanup: close the session, clean up unfinished database
19+
transactions, reset factories and non-persistent services, clean up event
20+
listeners and performance logs, and reset the debug toolbar.
21+
22+
- Preserve the phase ordering unless the change explicitly proves a different
23+
order is safe.
24+
- Check every new mutable static property, singleton, shared service, event
25+
listener, connection, handler, or global for cross-request state leakage.
26+
- Do not preserve a service across requests merely for performance. Persistent
27+
services must be safe to reuse and must not retain request, response, user,
28+
route, security token, locale, or error state.
29+
- Ensure exceptions and early exits cannot skip cleanup needed before the next
30+
request.
31+
- For state-isolation fixes, prefer a regression test that exercises two
32+
sequential requests or reset cycles in the same process and proves the
33+
second request cannot observe the first request's state.
34+
- If the template contract changes, update focused assertions in
35+
`tests/system/Commands/Worker/WorkerCommandsTest.php`.
36+
- If existing installations need the new generated entry point, update the
37+
changelog and upgrading guide and instruct users to run
38+
`php spark worker:install --force`.

‎.github/labeler.yml‎

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

‎.github/mergeable.yml‎

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

0 commit comments

Comments
 (0)