Deprecated function: Creation of dynamic property is deprecated

Created on 5 November 2023, about 1 year ago
Updated 15 June 2024, 5 months ago

Problem/Motivation

Deprecation notices such as the following:

Deprecated function: Creation of dynamic property hostingService_remote_import_hostmaster::$remote_user is deprecated in hostingService_remote_import_hostmaster->load() (line 41 of profiles/hostmaster/modules/aegir/hosting_remote_import/hosting_remote_import.service.inc).

Deprecated function: Creation of dynamic property hostingService_http_apache::$port is deprecated in hostingService->setValues() (line 71 of profiles/hostmaster/modules/aegir/hosting/server/hosting_server.service.inc).

Steps to reproduce

Check the logs after browsing your Aegir site on PHP 8.2.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States jacob.embree

Live updates comments and jobs are added and updated live.
  • PHP 8.2

    The issue particularly affects sites running on PHP version 8.2.0 or later.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @jacob.embree
  • Status changed to Needs work 10 months ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom steven jones

    Thanks for the bug report, and the patch. Here's some feedback:

    1. +++ b/db_server/hosting_db_server.service.inc
      @@ -18,6 +18,8 @@ class hostingService_db_mysql extends hostingService_db {
      +  public $db_user;
      +  public $db_passwd;
      

      I wonder if it's worth defaulting these to empty strings, rather than NULLs?

    2. +++ b/server/hosting_server.service.inc
      @@ -24,7 +24,9 @@ class hostingService {
      +  public $restart_cmd;
      

      I think this could/should be protected rather than public.

    3. +++ b/server/hosting_server.service.inc
      @@ -24,7 +24,9 @@ class hostingService {
      +  public $port;
      

      I think this could/should be protected rather than public.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia mohd sahzad

    Mohd Sahzad โ†’ made their first commit to this issueโ€™s fork.

  • Merge request !6fixed deprecated issue โ†’ (Open) created by mohd sahzad
  • Status changed to Needs review 10 months ago
  • Pipeline finished with Success
    10 months ago
    Total: 101s
    #87893
  • Status changed to Needs work 8 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States SocialNicheGuru

    The protected value in MR does not work:

    mysite.com/node/25074/goto_site|https://mysite.com|1||Deprecated function: Creation of dynamic property hostingService_http_https_nginx::$https_enabled is deprecated in hostingService_https->load() (line 12 of /aegir/hosting_https/hosting_https.service.inc).
    Mar 26 08:37:33 dev dev.cciplatform.com: mysite.com/node/25074/goto_site|https://mysite.com/hosting/c/dev1-ao.dev.cciplatform.com|1||Error: Cannot access protected property hostingService_http_https_nginx::$port in _hosting_site_url() (line 249 of /aegir/profiles/hostmaster/modules/aegir/hosting/site/hosting_site.module).

  • Status changed to Needs review 5 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States SocialNicheGuru

    Updated by adding getPort method

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States SocialNicheGuru

    added $https_enabled

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States SocialNicheGuru
Production build 0.71.5 2024