Make WordPress Core

Changeset 56346


Ignore:
Timestamp:
08/02/2023 10:57:10 AM (17 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-debug-data.php

    r56273 r56346  
    701701        }
    702702
    703         if ( function_exists( 'php_sapi_name' ) ) {
    704             $php_sapi = php_sapi_name();
    705         } else {
    706             $php_sapi = 'unknown';
    707         }
    708 
    709703        $info['wp-server']['fields']['server_architecture'] = array(
    710704            'label' => __( 'Server architecture' ),
     
    724718        $info['wp-server']['fields']['php_sapi']            = array(
    725719            'label' => __( 'PHP SAPI' ),
    726             'value' => ( 'unknown' !== $php_sapi ? $php_sapi : __( 'Unable to determine PHP SAPI' ) ),
    727             'debug' => $php_sapi,
     720            'value' => PHP_SAPI,
     721            'debug' => PHP_SAPI,
    728722        );
    729723
Note: See TracChangeset for help on using the changeset viewer.