Пример #1
0
function mwp_is_shell_available()
{
    if (mwp_container()->getParameter('disable_shell')) {
        return false;
    }
    if (mwp_is_safe_mode()) {
        return false;
    }
    if (!function_exists('proc_open') || !function_exists('escapeshellarg')) {
        return false;
    }
    $neededFunction = array('proc_get_status', 'proc_open');
    $disabledFunction = mwp_get_disabled_functions();
    if (count(array_diff($neededFunction, $disabledFunction)) != count($neededFunction)) {
        return false;
    }
    if (!mwp_is_nio_shell_available()) {
        return false;
    }
    return true;
}
Пример #2
0
 public function getServerInfo(array $options = array())
 {
     $context = $this->container->getWordPressContext();
     return array('phpVersion' => PHP_VERSION, 'mysqlVersion' => $context->getDb()->db_version(), 'extensionPdoMysql' => extension_loaded('pdo_mysql'), 'extensionOpenSsl' => extension_loaded('openssl'), 'extensionFtp' => extension_loaded('ftp'), 'extensionZlib' => extension_loaded('zlib'), 'extensionBz2' => extension_loaded('bz2'), 'extensionZip' => extension_loaded('zip'), 'extensionCurl' => extension_loaded('curl'), 'extensionGd' => extension_loaded('gd'), 'extensionImagick' => extension_loaded('imagick'), 'extensionSockets' => extension_loaded('sockets'), 'extensionSsh2' => extension_loaded('ssh2'), 'shellAvailable' => mwp_is_shell_available(), 'safeMode' => mwp_is_safe_mode(), 'memoryLimit' => mwp_format_memory_limit(ini_get('memory_limit')), 'disabledFunctions' => mwp_get_disabled_functions(), 'processArchitecture' => strlen(decbin(~0)), 'internalIp' => $this->container->getRequestStack()->getMasterRequest()->server['SERVER_ADDR'], 'uname' => php_uname('a'), 'hostname' => php_uname('n'), 'os' => strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' ? 'windows' : 'unix');
 }