Ejemplo n.º 1
0
function loader_compatibility_test($loader_location)
{
    $errors = array();
    $sysinfo = get_sysinfo();
    if (LOADER_NAME_CHECK) {
        $installed_loader_name = basename($loader_location);
        $expected_loader_name = get_loader_name();
        if ($installed_loader_name != $expected_loader_name) {
            $errors[] = "The installed loader (<code>{$installed_loader_name}</code>) does not have the name expected (<code>{$expected_loader_name}</code>) for your system. Please check that you have the correct Loader for your system.";
        }
    }
    if (empty($errors) && !is_readable($loader_location)) {
        $execute_error = "The loader at {$loader_location} does not appear to be readable.";
        $execute_error .= "<br>Please check that it exists and is readable.";
        $execute_error .= "<br>Please also check the permissions of the containing ";
        $execute_error .= (is_ms_windows() ? 'folder' : 'directory') . '.';
        if ($sysinfo['SS'] == 'IIS' || !($sysinfo['IS_CGI'] || $sysinfo['IS_CLI'])) {
            $execute_error .= "<br>Please also check that the web server has been restarted.";
        }
        $execute_error .= ".";
        $errors[] = $execute_error;
    }
    if (function_exists('file_get_contents')) {
        $loader_strs = @file_get_contents($loader_location);
    } else {
        $lines = @file($loader_location);
        $loader_strs = join(' ', $lines);
    }
    $phpv = php_version();
    if (preg_match("/php version:\\s*(.)\\.(.)\\.(..?)(-ts)?/i", $loader_strs, $version_matches)) {
        if ($version_matches[1] != $phpv['major'] || $version_matches[2] != $phpv['minor']) {
            $loader_php = $version_matches[1] . "." . $version_matches[2];
            $server_php = $phpv['major'] . "." . $phpv['minor'];
            $errors[] = "The installed loader is for PHP {$loader_php} but your server is running {$server_php}";
        }
        if (is_bool($sysinfo['THREAD_SAFE']) && $sysinfo['THREAD_SAFE'] && !is_ms_windows() && !(isset($version_matches[4]) && $version_matches[4] == '-ts')) {
            $errors[] = "Your server is running a thread-safe version of PHP but the Loader is not a thread-safe version.";
        } elseif (isset($version_matches[4]) && $version_matches[4] == '-ts' && !(is_bool($sysinfo['THREAD_SAFE']) && $sysinfo['THREAD_SAFE'])) {
            $errors[] = "Your server is running a non-thread-safe version of PHP but the Loader is a thread-safe version.";
        }
    } elseif (preg_match("/ioncube_loader_.\\.._(.)\\.(.)\\.(..?)(_nonts)?\\.dll/i", $loader_strs, $version_matches)) {
        if (!is_ms_windows()) {
            $errors[] = "You have a Windows Loader but your server does not appear to be running Windows.";
        } else {
            if (isset($version_matches[4]) && $version_matches[4] == '_nonts' && is_bool($sysinfo['THREAD_SAFE']) && $sysinfo['THREAD_SAFE']) {
                $errors[] = "You have the non-thread-safe version of the Windows Loader but you need the thread-safe one.";
            } elseif (!(is_bool($sysinfo['THREAD_SAFE']) && $sysinfo['THREAD_SAFE']) && !(isset($version_matches[4]) && $version_matches[4] == '_nonts')) {
                $errors[] = "You have the thread-safe version of the Windows Loader but you need the non-thread-safe one.";
            }
            if ($version_matches[1] != $phpv['major'] || $version_matches[2] != $phpv['minor']) {
                $loader_php = $version_matches[1] . "." . $version_matches[2];
                $server_php = $phpv['major'] . "." . $phpv['minor'];
                $errors[] = "The installed Loader is for PHP {$loader_php} but your server is running PHP {$server_php}.";
            }
        }
    } else {
        $errors[] = "PHP version for the Loader cannot be determined - please check that you have a valid ionCube Loader.";
    }
    if (preg_match("/target os:\\s*(.*)_(.*)-/i", $loader_strs, $os_matches)) {
        $loader_info = get_loaderinfo();
        if (strtolower($loader_info['osname']) != $os_matches[1]) {
            $errors[] = "You have the wrong loader for your operating system, " . $loader_info['osname'] . ".";
        } elseif ($loader_info['arch'] == $os_matches[2]) {
            $errors[] = "You have the wrong loaders for your operating system and machine architecture - " . $loader_info['osname'] . " on " . $loader_info['arch'];
        }
    }
    return $errors;
}
Ejemplo n.º 2
0
 /**
  * Get new articles since a date.
  *
  * Returns a list of message-ids of new articles (since the specified date
  * and time) in the groups whose names match the wildmat
  *
  * <b>Usage example:</b>
  * {@example docs/examples/phpdoc/getNewArticles.php}
  *
  * @param mixed	$time	<br>
  *  - (integer)	A timestamp
  *  - (string)	Somthing parseable by strtotime() like '-1 week'
  * @param string	$groups	(optional) 
  * @param string	$distributions	(optional) 
  *
  * @return mixed <br>
  *  - (array)	
  *  - (object)	Pear_Error on failure
  * @access public
  * @since 1.3.0
  */
 function getNewArticles($time, $groups = '*', $distribution = null)
 {
     switch (true) {
         case is_integer($time):
             break;
         case is_string($time):
             $time = strtotime($time);
             if ($time === false || $time === -1 && version_compare(php_version(), '5.1.0', '<')) {
                 $this->throwError('$time could not be converted into a timestamp!', null, 0);
             }
             break;
         default:
             trigger_error('$time must be either a string or an integer/timestamp!', E_USER_ERROR);
     }
     return $this->cmdNewnews($time, $groups, $distribution);
 }
Ejemplo n.º 3
0
 function op_user($channel = '', $user = '', $op = true)
 {
     if ($channel == '' || $user == '') {
         if ($channel == '') {
             $channel = $this->ex[2];
         }
         if ($user == '') {
             if (php_version() >= '5.3.0') {
                 $user = strstr($this->ex[0], '!', true);
             } else {
                 $length = strstr($this->ex[0], '!');
                 $user = substr($this->ex[0], 0, $length);
             }
         }
     }
     if ($op) {
         $this->send_data('MODE', $channel . ' +o ' . $user);
     } else {
         $this->send_data('MODE', $channel . ' -o ' . $user);
     }
 }
Ejemplo n.º 4
0
function loader_compatibility_test($loader_location)
{
    $errors = array();
    $sysinfo = get_sysinfo();
    if (LOADER_NAME_CHECK) {
        $installed_loader_name = basename($loader_location);
        $expected_loader_name = get_loader_name();
        if ($installed_loader_name != $expected_loader_name) {
            $errors[ERROR_LOADER_UNEXPECTED_NAME] = "安装的loader (<code>{$installed_loader_name}</code>) 不是系统支持的loader (<code>{$expected_loader_name}</code>) 。 请检查loader与系统是否兼容。";
        }
    }
    if (empty($errors) && !is_readable($loader_location)) {
        $execute_error = "{$loader_location下的loader不可读。}";
        $execute_error .= "<br>请检查它是否存在或可读。";
        $execute_error .= "<br>请检查目录权限 ";
        $execute_error .= (is_ms_windows() ? 'folder' : 'directory') . '.';
        if ($sysinfo['SS'] == 'IIS' || !($sysinfo['IS_CGI'] || $sysinfo['IS_CLI'])) {
            $execute_error .= "<br>请检查服务器是否已经重启了。";
        }
        $execute_error .= ".";
        $errors[ERROR_LOADER_NOT_READABLE] = $execute_error;
    }
    $loader_strs = get_loader_strings($loader_location);
    $phpv = php_version();
    if (preg_match("/php version:\\s*(.)\\.(.)\\.(..?)(-ts)?/i", $loader_strs, $version_matches)) {
        if ($version_matches[1] != $phpv['major'] || $version_matches[2] != $phpv['minor']) {
            $loader_php = $version_matches[1] . "." . $version_matches[2];
            $server_php = $phpv['major'] . "." . $phpv['minor'];
            $errors[ERROR_LOADER_PHP_MISMATCH] = "安装的loader用于 PHP {$loader_php,但服务器是} PHP {$server_php}.";
        }
        if (is_bool($sysinfo['THREAD_SAFE']) && $sysinfo['THREAD_SAFE'] && !is_ms_windows() && !(isset($version_matches[4]) && $version_matches[4] == '-ts')) {
            $errors[ERROR_LOADER_NONTS_PHP_TS] = "服务器运行的PHP是线程安全的,但是该loader不是线程安全的。";
        } elseif (isset($version_matches[4]) && $version_matches[4] == '-ts' && !(is_bool($sysinfo['THREAD_SAFE']) && $sysinfo['THREAD_SAFE'])) {
            $errors[ERROR_LOADER_TS_PHP_NONTS] = "服务器运行的PHP版本是非线程安全的,但该版本的loader是线程安全的。";
        }
    } elseif (preg_match("/ioncube_loader_.\\.._(.)\\.(.)\\.(..?)(_nonts)?\\.dll/i", $loader_strs, $version_matches)) {
        if (!is_ms_windows()) {
            $errors[ERROR_LOADER_WIN_SERVER_NONWIN] = "这是一个Windows版本的loader,但服务器好像不是Windows系统。";
        } else {
            if (isset($version_matches[4]) && $version_matches[4] == '_nonts' && is_bool($sysinfo['THREAD_SAFE']) && $sysinfo['THREAD_SAFE']) {
                $errors[ERROR_LOADER_WIN_NONTS_PHP_TS] = "该loader版本是非线程安全的,这里需要一个线程安全的版本。";
            } elseif (!(is_bool($sysinfo['THREAD_SAFE']) && $sysinfo['THREAD_SAFE']) && !(isset($version_matches[4]) && $version_matches[4] == '_nonts')) {
                $errors[ERROR_LOADER_WIN_TS_PHP_NONTS] = "该loader版本是线程安全的,这里需要一个非线程安全的版本。";
            }
            if ($version_matches[1] != $phpv['major'] || $version_matches[2] != $phpv['minor']) {
                $loader_php = $version_matches[1] . "." . $version_matches[2];
                $server_php = $phpv['major'] . "." . $phpv['minor'];
                $errors[ERROR_LOADER_WIN_PHP_MISMATCH] = "已安装的loader用于 PHP {$loader_php} ,但服务器的PHP版本是 {$server_php}.";
            }
            if (preg_match("/assemblyIdentity.*version=\"([^.]+)\\./", $loader_strs, $compiler_matches)) {
                $loader_compiler = "VC" . strtoupper($compiler_matches[1]);
            } else {
                $loader_compiler = 'VC6';
            }
            if ($loader_compiler != $sysinfo['PHP_COMPILER']) {
                $errors[ERROR_LOADER_WIN_COMPILER_MISMATCH] = "该loader用 {$loader_compiler} 编译,这里需要用 {$sysinfo['PHP_COMPILER']}编译。";
            }
        }
    } else {
        $errors[ERROR_LOADER_PHP_VERSION_UNKNOWN] = "未能检测服务器的PHP版本 - 请自行安装可用的loader。";
    }
    $errors += os_arch_string_check($loader_strs);
    return $errors;
}
Ejemplo n.º 5
0
function loader_compatibility_test($loader_location)
{
    $errors = array();
    $sysinfo = get_sysinfo();
    if (LOADER_NAME_CHECK) {
        $installed_loader_name = basename($loader_location);
        $expected_loader_name = get_loader_name();
        if ($installed_loader_name != $expected_loader_name) {
            $errors[ERROR_LOADER_UNEXPECTED_NAME] = "The installed loader (<code>{$installed_loader_name}</code>) does not have the name expected (<code>{$expected_loader_name}</code>) for your system. Please check that you have the correct loader for your system.";
        }
    }
    if (empty($errors) && !is_readable($loader_location)) {
        $execute_error = "The loader at {$loader_location} does not appear to be readable.";
        $execute_error .= "<br>Please check that it exists and is readable.";
        $execute_error .= "<br>Please also check the permissions of the containing ";
        $execute_error .= (is_ms_windows() ? 'folder' : 'directory') . '.';
        if ($sysinfo['SS'] == 'IIS' || !($sysinfo['IS_CGI'] || $sysinfo['IS_CLI'])) {
            $execute_error .= "<br>Please also check that the web server has been restarted.";
        }
        $execute_error .= ".";
        $errors[ERROR_LOADER_NOT_READABLE] = $execute_error;
    }
    $loader_strs = get_loader_strings($loader_location);
    $phpv = php_version();
    if (preg_match("/php version:\\s*(.)\\.(.)\\.(..?)(-ts)?/i", $loader_strs, $version_matches)) {
        if ($version_matches[1] != $phpv['major'] || $version_matches[2] != $phpv['minor']) {
            $loader_php = $version_matches[1] . "." . $version_matches[2];
            $server_php = $phpv['major'] . "." . $phpv['minor'];
            $errors[ERROR_LOADER_PHP_MISMATCH] = "The installed loader is for PHP {$loader_php} but your server is running PHP {$server_php}.";
        }
        if (is_bool($sysinfo['THREAD_SAFE']) && $sysinfo['THREAD_SAFE'] && !is_ms_windows() && !(isset($version_matches[4]) && $version_matches[4] == '-ts')) {
            $errors[ERROR_LOADER_NONTS_PHP_TS] = "Your server is running a thread-safe version of PHP but the loader is not a thread-safe version.";
        } elseif (isset($version_matches[4]) && $version_matches[4] == '-ts' && !(is_bool($sysinfo['THREAD_SAFE']) && $sysinfo['THREAD_SAFE'])) {
            $errors[ERROR_LOADER_TS_PHP_NONTS] = "Your server is running a non-thread-safe version of PHP but the loader is a thread-safe version.";
        }
    } elseif (preg_match("/ioncube_loader_.\\.._(.)\\.(.)\\.(..?)(_nonts)?\\.dll/i", $loader_strs, $version_matches)) {
        if (!is_ms_windows()) {
            $errors[ERROR_LOADER_WIN_SERVER_NONWIN] = "You have a Windows loader but your server does not appear to be running Windows.";
        } else {
            if (isset($version_matches[4]) && $version_matches[4] == '_nonts' && is_bool($sysinfo['THREAD_SAFE']) && $sysinfo['THREAD_SAFE']) {
                $errors[ERROR_LOADER_WIN_NONTS_PHP_TS] = "You have the non-thread-safe version of the Windows loader but you need the thread-safe one.";
            } elseif (!(is_bool($sysinfo['THREAD_SAFE']) && $sysinfo['THREAD_SAFE']) && !(isset($version_matches[4]) && $version_matches[4] == '_nonts')) {
                $errors[ERROR_LOADER_WIN_TS_PHP_NONTS] = "You have the thread-safe version of the Windows loader but you need the non-thread-safe one.";
            }
            if ($version_matches[1] != $phpv['major'] || $version_matches[2] != $phpv['minor']) {
                $loader_php = $version_matches[1] . "." . $version_matches[2];
                $server_php = $phpv['major'] . "." . $phpv['minor'];
                $errors[ERROR_LOADER_WIN_PHP_MISMATCH] = "The installed loader is for PHP {$loader_php} but your server is running PHP {$server_php}.";
            }
            if (preg_match("/assemblyIdentity.*version=\"([^.]+)\\./", $loader_strs, $compiler_matches)) {
                $loader_compiler = "VC" . strtoupper($compiler_matches[1]);
            } else {
                $loader_compiler = 'VC6';
            }
            if ($loader_compiler != $sysinfo['PHP_COMPILER']) {
                $errors[ERROR_LOADER_WIN_COMPILER_MISMATCH] = "Your loader was built using {$loader_compiler} but you need the loader built using {$sysinfo['PHP_COMPILER']}.";
            }
        }
    } else {
        $errors[ERROR_LOADER_PHP_VERSION_UNKNOWN] = "The PHP version for the loader cannot be determined - please check that you have a valid ionCube Loader.";
    }
    $errors += os_arch_string_check($loader_strs);
    return $errors;
}
// Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something ending in php.cgi for all requests
if ( isset($_SERVER['SCRIPT_FILENAME']) && ( strpos($_SERVER['SCRIPT_FILENAME'], 'php.cgi') == strlen($_SERVER['SCRIPT_FILENAME']) - 7 ) )
	$_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED'];

// Fix for Dreamhost and other PHP as CGI hosts
if (strpos($_SERVER['SCRIPT_NAME'], 'php.cgi') !== false)
	unset($_SERVER['PATH_INFO']);

// Fix empty PHP_SELF
$PHP_SELF = $_SERVER['PHP_SELF'];
if ( empty($PHP_SELF) )
	$_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace("/(\?.*)?$/",'',$_SERVER["REQUEST_URI"]);

if ( version_compare( '4.3', phpversion(), '>' ) ) {
	die( sprintf( /*WP_I18N_OLD_PHP*/'Your server is running PHP version %s but WordPress requires at least 4.3.'/*/WP_I18N_OLD_PHP*/, php_version() ) );
}

if ( !defined('WP_CONTENT_DIR') )
	define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // no trailing slash, full paths only - WP_CONTENT_URL is defined further down

if ( !extension_loaded('mysql') && !file_exists(WP_CONTENT_DIR . '/db.php') )
	die( /*WP_I18N_OLD_MYSQL*/'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.'/*/WP_I18N_OLD_MYSQL*/ );

/**
 * timer_start() - PHP 4 standard microtime start capture
 *
 * @access private
 * @since 0.71
 * @global int $timestart Seconds and Microseconds added together from when function is called
 * @return bool Always returns true
Ejemplo n.º 7
0
}
// Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something ending in php.cgi for all requests
if (isset($_SERVER['SCRIPT_FILENAME']) && strpos($_SERVER['SCRIPT_FILENAME'], 'php.cgi') == strlen($_SERVER['SCRIPT_FILENAME']) - 7) {
    $_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED'];
}
// Fix for Dreamhost and other PHP as CGI hosts
if (strpos($_SERVER['SCRIPT_NAME'], 'php.cgi') !== false) {
    unset($_SERVER['PATH_INFO']);
}
// Fix empty PHP_SELF
$PHP_SELF = $_SERVER['PHP_SELF'];
if (empty($PHP_SELF) || constant('VHOST') == 'no') {
    $_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace("/(\\?.*)?\$/", '', $_SERVER["REQUEST_URI"]);
}
if (version_compare('4.3', phpversion(), '>')) {
    die(sprintf('Your server is running PHP version %s but WordPress requires at least 4.3.', php_version()));
}
if (!defined('WP_CONTENT_DIR')) {
    define('WP_CONTENT_DIR', ABSPATH . 'wp-content');
}
// no trailing slash, full paths only - WP_CONTENT_URL is defined further down
if (!extension_loaded('mysql') && !file_exists(WP_CONTENT_DIR . '/db.php')) {
    die('Your PHP installation appears to be missing the MySQL extension which is required by WordPress.');
}
/**
 * timer_start() - PHP 4 standard microtime start capture
 *
 * @access private
 * @since 0.71
 * @global int $timestart Seconds and Microseconds added together from when function is called
 * @return bool Always returns true
Ejemplo n.º 8
0
if (isset($_SERVER['HTTP_USER_AGENT'])) {
    if (preg_match('`MSIE`', $_SERVER['HTTP_USER_AGENT'])) {
        header('Content-Disposition: inline; filename="' . $nomsql . '"');
        header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
        header('Pragma: public');
    } else {
        header('Content-Disposition: attachment; filename="' . $nomsql . '"');
        header('Pragma: no-cache');
    }
}
$fd = '';
$fd .= "#**************** BASE DE DONNEES " . $dbDb . " ****************" . "\n" . date("\\#\\ \\L\\e\\ \\:\\ d\\ m\\ Y\\ \\a\\ H\\h\\ i") . "\n";
if (isset($_SERVER['SERVER_NAME'])) {
    $fd .= "# Serveur : " . $_SERVER['SERVER_NAME'] . "\n";
}
$fd .= "# Version PHP : " . php_version() . "\n";
$fd .= "# Version mySQL : " . mysql_version() . "\n";
$fd .= "# Version GRR : " . affiche_version() . "\n";
if (isset($_SERVER['REMOTE_ADDR'])) {
    $fd .= "# IP Client : " . $_SERVER['REMOTE_ADDR'] . "\n";
}
$fd .= "# Fichier SQL compatible PHPMyadmin\n#\n";
$fd .= "# ******* debut du fichier ********\n";
$j = '0';
while ($j < count($liste_tables)) {
    $temp = $table_prefix . $liste_tables[$j];
    if ($structure) {
        $fd .= "#\n# Structure de la table {$temp}\n#\n";
        $fd .= "DROP TABLE IF EXISTS `{$temp}`;\n";
        // requete de creation de la table
        $query = "SHOW CREATE TABLE {$temp}";
Ejemplo n.º 9
0
function ioncube_24_is_available()
{
    $loaderinfo = get_loaderinfo();
    $php_ver = php_version();
    return $loaderinfo['oscode'] == 'lin' && ($php_ver['major'] == 5 && $php_ver['minor'] >= 3 || $php_ver['major'] > 5);
}
Ejemplo n.º 10
0
    $database->setQuery($query);
    $users = $database->loadObjectList();
    if (count($users) == 0) {
        //echo _UE_NOSUCHPROFILE;
        jTipsLogger::_log('current user does not exist in community builder 1.1', 'ERROR');
        return "";
    }
    $user = $users[0];
    $path = getFieldValue('image', $user->avatar, $user);
    //jTipsDebug($path);
    //need to strip the img tag and get the src
    $path = preg_replace('/.*<img src="([^"]+)".*/is', '\\1', $path);
    return $mosConfig_live_site . '/' . $path;
}
if (!function_exists('http_build_query')) {
    jTipsLogger::_log('http_build_query does not exists in this version - ' . php_version(), 'WARN');
    /**
     * This should be moved to compat.php
     * Contruct a http query string from an associative array
     * LEGACY FUNCTION - see php.net for structure.
     *
     * @param $a
     * @param $b
     * @param $c
     * @return string The query
     */
    function http_build_query($a, $b = '', $c = 0)
    {
        if (!is_array($a)) {
            return false;
        }
Ejemplo n.º 11
0
<?php

if (php_version() > 3) {
}
if (PHP_SAPI() > 3) {
}
fopen('php://stdin', 'r');
fopen("php://stdout", 'w');
fopen('php://stderr', 'w');
$a->php_version();
\a\b\PHP_sapi();
Ejemplo n.º 12
0
 function version()
 {
     return php_version();
 }