Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 5 additions & 7 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
language: "en-US"
early_access: false
tone_instructions: >-
Expert PHP reviewer. Focus on type safety, PSR-12, PHP 7.2
compatibility, and security. XOOPS Core supports PHP 7.2-8.5;
avoid PHP 8.0+ language features.
Expert PHP reviewer. Focus on type safety, PSR-12, and security.
XOOPS Core 2.6 requires PHP 8.4 or later (composer.json.dist), so
PHP 8.x language features are allowed.

reviews:
profile: "assertive"
Expand All @@ -19,14 +19,12 @@ reviews:
path_instructions:
- path: "xoops_lib/**/*.php"
instructions: >-
Review for PHP 7.2 compatibility (no union types, named arguments,
match expressions, enums, readonly, constructor promotion, fibers,
intersection types, never return type, or first-class callable syntax).
Code targets PHP 8.4+; do not flag PHP 7.x or 8.0-8.3 compatibility.
Check for proper use of declare(strict_types=1), self:: for class
constants, and PSR-12 code style.
- path: "htdocs/kernel/**/*.php"
instructions: >-
Review legacy kernel code for PHP 7.2 compatibility and security.
Review legacy kernel code for security.
Check for SQL injection, XSS, and proper input sanitization.
- path: "tests/**/*.php"
instructions: >-
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ body:
attributes:
label: PHP Version
description: Provide the PHP version that you are using.
options: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5 (pre-release)']
options: ['8.4', '8.5']
multiple: true
validations:
required: true
Expand Down
4 changes: 2 additions & 2 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Composer vendors install to `xoops_lib/vendor/` (non-standard path). PHPUnit con

## PHP Compatibility

Code must run on PHP 7.2 through 8.5. Do not use language features introduced after PHP 7.2, including but not limited to PHP 7.3+ (trailing commas in function calls, flexible heredoc/nowdoc), PHP 7.4+ (typed properties, arrow functions, null coalescing assignment `??=`, numeric literal separators, spread operator in arrays), and PHP 8.0+ (named arguments, match expressions, union type hints in signatures, enums, fibers, readonly properties, intersection types, `never` return type, first-class callable syntax, constructor promotion). CI tests all versions in the matrix.
Code must run on PHP 8.4 and later, the minimum in `composer.json.dist`. PHP 8.x language features are allowed; do not flag PHP 7.x or 8.0-8.3 compatibility. CI tests PHP 8.4.

## Coding Conventions

Expand Down Expand Up @@ -79,7 +79,7 @@ XOOPS 2.6 uses `\Xoops::getInstance()` for core access. Libraries check `class_e

1. Code follows PSR-12 and passes code style checks.
2. Static analysis passes with no new errors beyond the baseline.
3. Tests pass on all supported PHP versions (7.2-8.5).
3. Tests pass on PHP 8.4.
4. New public methods have PHPDoc with `@param`, `@return`, and `@throws` tags.
5. New functionality has corresponding unit tests in `tests/unit/`.
6. Changes are documented in the changelog.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ It's under development currently. If you want to build a web site using XOOPS, v

Here is an outline of what you need to participate in XOOPS development:

You will need a development environment with at least PHP 7.2 and MySQL 5.6 or equivalent MariaDB.
You will need a development environment with at least PHP 8.4 and MySQL 5.6 or equivalent MariaDB.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Contributor guidance targets unsupported PHP

When a contributor follows the repository’s AI, Copilot, or CodeRabbit coding or review guidance, the guidance still presents PHP 7.2 as supported, and some instructions prohibit PHP 8+ features, so contributors target or test a runtime Composer rejects and avoid features supported by the project’s PHP 8.4 minimum.

Update the AI and review instructions, including the reusable Copilot template, to state the PHP 8.4 minimum and remove incompatible PHP 7.2 guidance.

Prompt for AI agents
In `README.md` at line 17:

**Contributor guidance targets unsupported PHP**

When a contributor follows the repository’s AI, Copilot, or CodeRabbit coding or review guidance, the guidance still presents PHP 7.2 as supported, and some instructions prohibit PHP 8+ features, so contributors target or test a runtime Composer rejects and avoid features supported by the project’s PHP 8.4 minimum.

Update the AI and review instructions, including the reusable Copilot template, to state the PHP 8.4 minimum and remove incompatible PHP 7.2 guidance.


You will need to interact with [GitHub.com](https://guides.github.com/)

Expand Down
2 changes: 1 addition & 1 deletion htdocs/install/include/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ function xoDiagIfWritable($path)
*/
function xoPhpVersion()
{
if (version_compare(phpversion(), '7.1.0', '>=')) {
if (version_compare(phpversion(), '8.4.0', '>=')) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Welcome page permits unsupported PHP

When a user reads the installer welcome page while using PHP 7.1–8.3, the welcome page says PHP 7.1 or higher meets the requirement, while xoPhpVersion() marks PHP below 8.4 as unsupported and Composer rejects it; users are told they can proceed with an unsupported runtime and later encounter the requirement failure.

Update the welcome page’s PHP requirement to match the 8.4 minimum checked by the installer and Composer.

Prompt for AI agents
In `htdocs/install/include/functions.php` at line 233:

**Welcome page permits unsupported PHP**

When a user reads the installer welcome page while using PHP 7.1–8.3, the welcome page says PHP 7.1 or higher meets the requirement, while `xoPhpVersion()` marks PHP below 8.4 as unsupported and Composer rejects it; users are told they can proceed with an unsupported runtime and later encounter the requirement failure.

Update the welcome page’s PHP requirement to match the 8.4 minimum checked by the installer and Composer.

return xoDiag(1, phpversion());
} else {
return xoDiag(-1, phpversion());
Expand Down
Loading