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

[PHP 8.1] Method mysqli::get_client_info() is deprecated #16911

Closed
williamdes opened this issue May 21, 2021 · 8 comments
Closed

[PHP 8.1] Method mysqli::get_client_info() is deprecated #16911

williamdes opened this issue May 21, 2021 · 8 comments
Assignees
Labels
Bug A problem or regression with an existing feature
Projects
Milestone

Comments

@williamdes
Copy link
Member

williamdes commented May 21, 2021

Describe the bug

Deprecation Notice in ./libraries/classes/Dbal/DbiMysqli.php#400
 Method mysqli::get_client_info() is deprecated

Backtrace

DatabaseInterface.php#2150: PhpMyAdmin\Dbal\DbiMysqli->getClientInfo()
HomeController.php#180: PhpMyAdmin\DatabaseInterface->getClientInfo()
Routing.php#187: PhpMyAdmin\Controllers\HomeController->index(array)
./../../../../index.php#18: PhpMyAdmin\Routing::callControllerForRoute(
string '/',
,
,
)

To Reproduce

Steps to reproduce the behavior:

  1. Go to home page

Server configuration

  • PHP version: 8.1
  • phpMyAdmin version: 5.1

See: https://php.watch/versions/8.1/mysqli_get_client_info-deprecation

@williamdes williamdes added the Bug A problem or regression with an existing feature label May 21, 2021
@williamdes williamdes added this to Needs triage in issues via automation May 21, 2021
@williamdes williamdes moved this from Needs triage to Low priority in issues May 21, 2021
@williamdes
Copy link
Member Author

Hi @Ayesh
Maybe you would want to cover this on https://php.watch/versions/8.1
Ref: php/php-src@7e9f6d2
Maybe ref: php/php-src#6777

@williamdes williamdes self-assigned this May 28, 2021
@williamdes williamdes added this to the 5.1.1 milestone May 28, 2021
williamdes added a commit that referenced this issue May 28, 2021
Ref: #16911

Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue May 28, 2021
Signed-off-by: William Desportes <williamdes@wdes.fr>
@williamdes williamdes moved this from Low priority to Reproduced in issues May 28, 2021
issues automation moved this from Reproduced to Closed May 28, 2021
@Ayesh
Copy link

Ayesh commented May 29, 2021

Thank you so much @williamdes, I just posted mysqli::get_client_info method and mysqli_get_client_info($param) is deprecated with this. Super grateful for the me 🙏🏼.

@williamdes
Copy link
Member Author

Thank you so much @williamdes, I just posted mysqli::get_client_info method and mysqli_get_client_info($param) is deprecated with this. Super grateful for the me 🙏🏼.

Thank you so much for the nice article !

@williamdes williamdes mentioned this issue Jun 2, 2021
10 tasks
@kamil-tekiela
Copy link
Contributor

Hi. I am curious why did you decide to add conditional call to get_client_info for PHP < 8.1? Why isn't the method call simply replaced with the function call mysqli_get_client_info or the property client_info (if you want to retain OO-style)?

@williamdes
Copy link
Member Author

Hi. I am curious why did you decide to add conditional call to get_client_info for PHP < 8.1? Why isn't the method call simply replaced with the function call mysqli_get_client_info or the property client_info (if you want to retain OO-style)?

Well, its more that I want no side effects on older versions ;)
Even if there is no side effects, just avoiding to create one can save me a lot of time dealing with angry people that I would have broken their workflow

It's a support everyone nicely way of thinking and anyway, this is only my way of thinking ;)
feel free to let us know what you think about it

@kamil-tekiela
Copy link
Contributor

I understand, but this functionality hasn't changed in many years, probably never. See https://phpize.online/?phpses=0671e6bc6998c43b2658bf96372ab42a&sqlses=null&php_version=php5&sql_version=mysql57

You could have used the property in this place instead of checking the PHP version. Can I suggest PR to simplify this?

@williamdes
Copy link
Member Author

I understand, but this functionality hasn't changed in many years, probably never. See https://phpize.online/?phpses=0671e6bc6998c43b2658bf96372ab42a&sqlses=null&php_version=php5&sql_version=mysql57

You could have used the property in this place instead of checking the PHP version. Can I suggest PR to simplify this?

I am not sure, what do you thing @MauricioFauth ?

@MauricioFauth
Copy link
Member

We can safely use just return mysqli_get_client_info();. That is what was used before the change to OO style.

MauricioFauth pushed a commit that referenced this issue Oct 28, 2021
See #16911

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
MauricioFauth added a commit that referenced this issue Oct 28, 2021
Related to #16911

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A problem or regression with an existing feature
Projects
issues
  
Closed
Development

No branches or pull requests

4 participants