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

Drupal: PHP7 fixes for boinc modules #2982

Merged
merged 5 commits into from
Jan 31, 2019

Conversation

drshawnkwang
Copy link
Contributor

Description of the Change
Modified boinc modules to fix PHP 7 compatibility issues

  • mysql_xyz() functions replaced with mysqli_mxyz() functions.
  • Removed references to ini settings safe_mode.
  • Updated a class constructor to use modern PHP standards.

Release Notes
N/A

Part of https://dev.gridrepublic.org/browse/DBOINCP-468

@drshawnkwang
Copy link
Contributor Author

Closing - this needs to be tested further - will reopen/resubmit later.

@drshawnkwang
Copy link
Contributor Author

Did some more testing: Scrutinizer reports bugs on the new mysqli_num_rows() functions:

$variable of type `false|resource` is incompatible with the type `mysqli_result` expected by parameter `$result` of `mysqli_num_rows()`. ( Ignorable by Annotation )

I tested the code and dumped out the class type of variable with get_class(), and it is an object of class mysqli_result. I don't know why the Scrutinizer flags the variable as being something else. I believe that the code should work. db_query will return a mysqli_result which will be passed to mysqli_num_rows() and be processed correctly.

As a result I am re-opening this PR.

@drshawnkwang drshawnkwang reopened this Jan 24, 2019
@drshawnkwang drshawnkwang changed the title Drupal fixphp7 boincmodules Drupal: PHP7 fixes for boinc modules Jan 24, 2019
@ChristianBeer
Copy link
Member

I also noticed a false positive involving incompatible types. I opened a bug report with scrutinizer about that. You could probably for now ignore those kind of bugs (while still doing a quick check though).

The set_time_limit() call was removed due to the safe mode association, which is no longer relevant in PHP7, but ini_get() will still work properly even if 'safe_mode' doesn't exist. Setting the timeout limit is helpful with large imports, so this functionality should be restored.
@tristanolive tristanolive merged commit 4b3fc26 into BOINC:master Jan 31, 2019
@drshawnkwang drshawnkwang deleted the drupal_fixphp7-boincmodules branch January 31, 2019 20:57
@AenBleidd AenBleidd added this to the Server Release 1.2.0 milestone Aug 14, 2023
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.

4 participants