Build/Test Tools: Introduce automated PHP compatibility checking.
This change introduces a new Composer script, `compat` that will scan the codebase for (detectable) potential PHP compatibility issues using the `PHP_CodeSniffer` and a custom ruleset based off of the `PHPCompayibilityWP` ruleset (`phpcompat.xml.dist`). The command will be run as a separate job within each Travis build. While many compatibility issues and false positives have already been corrected in this commit and other Trac tickets, there are still some remaining. For that reason, the job is allowed to fail while the remainder of the potential compatibility issues are investigated and addressed. After those are resolved, the job should be set as required to pass to help prevent new compatibility issues from being introduced. Props desrosj, jrf, all PHPCompatibilityWP and PHPCompatibility contributors. Fixes #46152. Built from https://develop.svn.wordpress.org/trunk@46290 git-svn-id: http://core.svn.wordpress.org/trunk@46102 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -728,7 +728,7 @@ class WP_Debug_Data {
|
||||
if ( isset( $wpdb->use_mysqli ) && $wpdb->use_mysqli ) {
|
||||
$client_version = $wpdb->dbh->client_info;
|
||||
} else {
|
||||
// phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysql_get_client_info
|
||||
// phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysql_get_client_info,PHPCompatibility.Extensions.RemovedExtensions.mysql_DeprecatedRemoved
|
||||
if ( preg_match( '|[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}|', mysql_get_client_info(), $matches ) ) {
|
||||
$client_version = $matches[0];
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user