Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Data::get_server_data()

Get PHP & Server Data


Return Return

(array)


Top ↑

Source Source

File: includes/class.llms.data.php

	private static function get_server_data() {

		global $wpdb;

		$data = array();

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

		$data['mysql_version'] = $wpdb->db_version();

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

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

		if ( isset( $_SERVER['SERVER_SOFTWARE'] ) && ! empty( $_SERVER['SERVER_SOFTWARE'] ) ) {
			$data['software'] = ! empty( $_SERVER['SERVER_SOFTWARE'] ) ? sanitize_text_field( wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) ) : '';
		}

		$data['wp_memory_limit'] = WP_MEMORY_LIMIT;

		ksort( $data );

		return $data;
	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.35.0 Sanitize $_SERVER data.
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.