WC_Tracker::get_server_info() – Get server related info.

You appear to be a bot. Output may be restricted

Description

Get server related info.

Usage

$array = WC_Tracker::get_server_info();

Parameters

Returns

array

Source

File name: woocommerce/includes/class-wc-tracker.php
Lines:

1 to 29 of 29
  private static function get_server_info() {
    $server_data = array();

    if ( ! empty( $_SERVER['SERVER_SOFTWARE'] ) ) {
      $server_data['software'] = $_SERVER['SERVER_SOFTWARE']; // @phpcs:ignore
    }

    if ( function_exists( 'phpversion' ) ) {
      $server_data['php_version'] = phpversion();
    }

    if ( function_exists( 'ini_get' ) ) {
      $server_data['php_post_max_size']  = size_format( wc_let_to_num( ini_get( 'post_max_size' ) ) );
      $server_data['php_time_limt']      = ini_get( 'max_execution_time' );
      $server_data['php_max_input_vars'] = ini_get( 'max_input_vars' );
      $server_data['php_suhosin']        = extension_loaded( 'suhosin' ) ? 'Yes' : 'No';
    }

    $database_version             = wc_get_server_database_version();
    $server_data['mysql_version'] = $database_version['number'];

    $server_data['php_max_upload_size']  = size_format( wp_max_upload_size() );
    $server_data['php_default_timezone'] = date_default_timezone_get();
    $server_data['php_soap']             = class_exists( 'SoapClient' ) ? 'Yes' : 'No';
    $server_data['php_fsockopen']        = function_exists( 'fsockopen' ) ? 'Yes' : 'No';
    $server_data['php_curl']             = function_exists( 'curl_init' ) ? 'Yes' : 'No';

    return $server_data;
  }
 

 View on GitHub View on Trac