From 9dc13e98d73c1917b2637613db34aab6d43deb27 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 2 Aug 2023 10:59:25 +0000 Subject: [PATCH] Site Health: Use `PHP_SAPI` constant instead of the `php_sapi_name()` function. This is a micro-optimization that removes an unnecessary function call. Follow-up to [44986], [45156]. Props ayeshrajans, jrf, mukesh27, rmccue. Fixes #58942. Built from https://develop.svn.wordpress.org/trunk@56346 git-svn-id: http://core.svn.wordpress.org/trunk@55858 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-debug-data.php | 10 ++-------- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/wp-admin/includes/class-wp-debug-data.php b/wp-admin/includes/class-wp-debug-data.php index 2cd930052f..39ecd016e8 100644 --- a/wp-admin/includes/class-wp-debug-data.php +++ b/wp-admin/includes/class-wp-debug-data.php @@ -700,12 +700,6 @@ class WP_Debug_Data { $php_version_debug .= ' 64bit'; } - if ( function_exists( 'php_sapi_name' ) ) { - $php_sapi = php_sapi_name(); - } else { - $php_sapi = 'unknown'; - } - $info['wp-server']['fields']['server_architecture'] = array( 'label' => __( 'Server architecture' ), 'value' => ( 'unknown' !== $server_architecture ? $server_architecture : __( 'Unable to determine server architecture' ) ), @@ -723,8 +717,8 @@ class WP_Debug_Data { ); $info['wp-server']['fields']['php_sapi'] = array( 'label' => __( 'PHP SAPI' ), - 'value' => ( 'unknown' !== $php_sapi ? $php_sapi : __( 'Unable to determine PHP SAPI' ) ), - 'debug' => $php_sapi, + 'value' => PHP_SAPI, + 'debug' => PHP_SAPI, ); // Some servers disable `ini_set()` and `ini_get()`, we check this before trying to get configuration values. diff --git a/wp-includes/version.php b/wp-includes/version.php index 9f2661793f..09805cac94 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.4-alpha-56345'; +$wp_version = '6.4-alpha-56346'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.