Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue 886 (installer with php8) #910

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ralfulrich
Copy link

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tested the changes
  • Build (/path/to/php cli.php cmd=build) was run locally and any changes were pushed

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Other (please describe):

What is the current behavior?

This is "just" an installer bug. It does not affect the runtime behaviour. The proposed fix here is not super-nice, but it does the job. It would be great if a real expert could just take out all this non-essential contant stuff from the installer.

Issue Number: 886
issue 886

See also:
stack overflow

What is the new behavior?

The installer works. Also on newer system with php8.

Does this introduce a breaking change?

  • Yes
  • No

Docs need to be updated?

  • Yes
  • No

Other information

@padams
Copy link
Collaborator

padams commented Feb 16, 2024

This actually seems like a decent fix without a major refactor. The choice to use constants was done before PHP had static object properties etc. as a way to ensure that DB plugins had a way of defining their own static strings before the DB class was instantiated. This was done a looooong time ago so I'm sure it could be improved and further refactored.

@padams
Copy link
Collaborator

padams commented Feb 16, 2024

oh wait. I take that back. yeah this isn't the way to fix this. All of these constants are already defined in the owa_db_mysql.php already. That file is supposed to get included very early in the runtime before the config obj is created to avoid this race condidtion. So the bug is the the file is not being included for some reason.

@mbtools
Copy link

mbtools commented Feb 18, 2024

owa_coreAPI::dbSingleton() is called in constructor of owa_install. However, parent::__construct() in owa_base comes first which calls owa_coreAPI::errorSingleton() and configSingleton() requiring the DB (constants) to be initiailized. For example. the error logger has settings, so requires config which requires DB.

Either there's a way to init the DB without requiring logging and config, or the other way around.

Hope that help to find a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants