| Server IP : 172.67.179.166 / Your IP : 162.159.108.100 Web Server : nginx/1.20.2 System : Linux 172-104-110-161.ip.linodeusercontent.com 3.10.0-1160.36.2.el7.x86_64 #1 SMP Wed Jul 21 11:57:15 UTC 2021 x86_64 User : www ( 1000) PHP Version : 8.1.9 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /www/wwwroot/lenovo-drivers.com/wordpress/wp-content/plugins/w3-total-cache/ |
Upload File : |
<?php
/**
* File: Util_Installed.php
*
* @package W3TC
*/
namespace W3TC;
/**
* Class Util_Installed
*
* Checks if different server modules are enabled and installed
*/
class Util_Installed {
/**
* Check for opcache
*
* @return bool
*/
public static function opcache() {
return function_exists( 'opcache_reset' ) && ini_get( 'opcache.enable' );
}
/**
* Check for apc
*
* @return bool
*/
public static function apc() {
return function_exists( 'apc_store' ) || function_exists( 'apcu_store' );
}
/**
* Check for apc opcache
*
* @return bool
*/
public static function apc_opcache() {
return function_exists( 'apc_compile_file' ) && ini_get( 'apc.enable' );
}
/**
* Checks for opcache valid timestamps
*
* @return string|bool
*/
public static function is_opcache_validate_timestamps() {
return ini_get( 'opcache.validate_timestamps' );
}
/**
* Checks for apc valid timestamps
*
* @return string|bool
*/
public static function is_apc_validate_timestamps() {
return ini_get( 'apc.stat' );
}
/**
* Check for curl
*
* @return bool
*/
public static function curl() {
return function_exists( 'curl_init' );
}
/**
* Check for eaccelerator
*
* @return bool
*/
public static function eaccelerator() {
return function_exists( 'eaccelerator_put' );
}
/**
* Check for ftp
*
* @return bool
*/
public static function ftp() {
return function_exists( 'ftp_connect' );
}
/**
* Check for memcached auth
*
* @return bool
*/
public static function memcached_auth() {
static $r = null;
if ( is_null( $r ) ) {
if ( ! class_exists( '\Memcached' ) ) {
$r = false;
} else {
$o = new \Memcached();
$r = method_exists( $o, 'setSaslAuthData' );
}
}
return $r;
}
/**
* Check for memcache/memcached
*
* @return bool
*/
public static function memcached() {
return class_exists( 'Memcache' ) || class_exists( 'Memcached' );
}
/**
* Check for memcached
*
* @return bool
*/
public static function memcached_memcached() {
return class_exists( 'Memcached' );
}
/**
* Check for memcached aws
*
* @return bool
*/
public static function memcached_aws() {
return class_exists( '\Memcached' ) && defined( '\Memcached::OPT_CLIENT_MODE' ) && defined( '\Memcached::DYNAMIC_CLIENT_MODE' );
}
/**
* Check for memcache auth
*
* @return bool
*/
public static function memcache_auth() {
static $r = null;
if ( is_null( $r ) ) {
if ( ! class_exists( '\Memcached' ) ) {
$r = false;
} else {
$o = new \Memcached();
$r = method_exists( $o, 'setSaslAuthData' );
}
}
return $r;
}
/**
* Check for redis
*
* @return bool
*/
public static function redis() {
return class_exists( 'Redis' );
}
/**
* Check for tidy
*
* @return bool
*/
public static function tidy() {
return class_exists( 'tidy' );
}
/**
* Check for wincache
*
* @return bool
*/
public static function wincache() {
return function_exists( 'wincache_ucache_set' );
}
/**
* Check for xcache
*
* @return bool
*/
public static function xcache() {
return function_exists( 'xcache_set' );
}
/**
* Check if memcache is available
*
* @param array $servers Servers.
* @param boolean $binary_protocol Binary protocol.
* @param string $username Username.
* @param string $password Password.
*
* @return boolean
*/
public static function is_memcache_available( $servers, $binary_protocol, $username, $password ) {
static $results = array();
$key = md5( implode( '', $servers ) );
if ( ! isset( $results[ $key ] ) ) {
$memcached = Cache::instance(
'memcached',
array(
'servers' => $servers,
'persistent' => false,
'binary_protocol' => $binary_protocol,
'username' => $username,
'password' => $password,
)
);
if ( is_null( $memcached ) ) {
return false;
}
$test_string = sprintf( 'test_' . md5( time() ) );
$test_value = array( 'content' => $test_string );
$memcached->set( $test_string, $test_value, 60 );
$test_value = $memcached->get( $test_string );
$results[ $key ] = ( ! empty( $test_value['content'] ) && $test_value['content'] === $test_string );
}
return $results[ $key ];
}
}