Skip to content

Nextcloud 33 support unnecessarily excludes PHP 8.3 #73

Description

@poehlert

Summary

The current NC33 version of mail_roundcube declares PHP 8.4 as its minimum supported PHP version:

<php min-version="8.4" max-version="8.5" />

This prevents installation on Nextcloud 33 installations running PHP 8.3, including Nextcloud AIO 33.0.6.

The current source contains a small number of PHP 8.4-only direct dereferences of new expressions. Rewriting those expressions using the PHP 8.3-compatible parenthesized syntax and lowering the metadata requirement to PHP 8.3 is sufficient for the application to build and run successfully.

Steps to reproduce

  1. Run Nextcloud 33 on PHP 8.3.
  2. Attempt to install or enable current mail_roundcube 1.3.0.
  3. Observe that the app dependency metadata requires PHP >= 8.4.
  4. Lower only the metadata constraint and lint the current PHP source with PHP 8.3.
  5. Observe PHP 8.4-only direct new dereference syntax.

Expected behavior

If mail_roundcube does not otherwise depend on PHP 8.4 functionality, the NC33 release should support PHP 8.3.

This is particularly useful because Nextcloud 33 is being deployed with PHP 8.3, including by Nextcloud AIO.

Actual behavior

appinfo/info.xml currently declares:

<php min-version="8.4" max-version="8.5" />

Current source also includes direct dereferencing such as:

new Response()->withStatus($httpStatusCode)->getReasonPhrase();

and:

new $phpType()->getName();

These can be expressed compatibly with PHP 8.3 as:

(new Response())->withStatus($httpStatusCode)->getReasonPhrase();

and:

(new $phpType())->getName();

Cause

The NC33 work introduced PHP 8.4 syntax and raised the minimum PHP version, although the affected expressions do not appear to require PHP 8.4 functionality.

The same operations can be expressed using syntax supported by PHP 8.3.

Proposed fix

  1. Replace the PHP 8.4-only direct dereferences of new expressions with equivalent PHP 8.3-compatible parenthesized expressions.
  2. Change the application dependency to:
<php min-version="8.3" max-version="8.5" />

I tested a local build with these compatibility changes on PHP 8.3.32.

The resulting application successfully:

  • installs and enables on Nextcloud 33.0.6;
  • loads its administration and personal settings;
  • saves per-user Roundcube credentials;
  • performs the server-side Roundcube login; and
  • loads the authenticated Roundcube iframe.

Environment

  • Nextcloud: 33.0.6
  • PHP: 8.3.32
  • mail_roundcube: 1.3.0 / current NC33 source
  • Roundcube: 1.7.3
  • Deployment: Nextcloud AIO

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions