script_version()); } else { return null; } } function check_for_wizard_update($echo_message = false) { $latest_version = latest_version(); $update_available = update_is_available($latest_version); if ($update_available) { if ($echo_message) { echo '

An updated version of this Wizard script is available here.

'; } return $latest_version; } else { return $update_available; } } function php_version() { $v = explode('.',PHP_VERSION); return array( 'major' => $v[0], 'minor' => $v[1], 'release' => $v[2]); } function is_supported_php_version() { $v = php_version(); return ((($v['major'] == 4) && ($v['minor'] >= 1)) || (($v['major'] == 5) && (($v['minor'] >= 1) || ($v['release'] >= 5)))); } function is_php_version_or_greater($major,$minor,$release = 0) { $version = php_version(); return ($version['major'] > $major || ($version['major'] == $major && $version['minor'] > $minor) || ($version['major'] == $major && $version['minor'] == $minor && $version['release'] >= $release)); } function ini_file_name() { $sysinfo = get_sysinfo(); return (!empty($sysinfo['PHP_INI'])?$sysinfo['PHP_INI_BASENAME']:'php.ini'); } function default_platform_list() { $platforms = array(); $platforms[] = array('os'=>'win', 'os_human'=>'Windows', 'arch'=>'x86', 'dirname'=>'win32', 'us1-dir'=>'windows/x86' ); $platforms[] = array('os'=>'win', 'os_human'=>'Windows (Non-TS)', 'os_mod' => '_nonts', 'arch'=>'x86', 'dirname'=>'win32-nonts', 'us1-dir'=>'windows/x86-nonts' ); $platforms[] = array('os'=>'lin', 'os_human'=>'Linux', 'arch'=>'x86', 'dirname'=>'linux_i686-glibc2.1.3', 'us1-dir'=>'linux/x86'); $platforms[] = array('os'=>'lin', 'os_human'=>'Linux', 'arch'=>'x86-64', 'dirname'=>'linux_x86_64-glibc2.3.4', 'us1-dir'=>'linux/x86_64'); $platforms[] = array('os'=>'lin','os_human'=>'Linux', 'arch'=>'ppc', 'dirname'=>'linux_ppc-glibc2.3.4','us1-dir'=>'linux/ppc'); $platforms[] = array('os'=>'lin','os_human'=>'Linux', 'arch'=>'ppc64', 'dirname'=>'linux_ppc64-glibc2.5','us1-dir'=>'linux/ppc64'); $platforms[] = array('os'=>'dra', 'os_human'=>'DragonFly', 'arch'=>'x86', 'dirname'=>'dragonfly_i386-1.7', 'us1-dir'=>'Dragonfly/x86'); $platforms[] = array('os'=>'fre', 'os_human'=>'FreeBSD 4', 'os_mod'=>'_4', 'arch'=>'x86', 'dirname'=>'freebsd_i386-4.8', 'us1-dir'=>'FreeBSD/v4'); $platforms[] = array('os'=>'fre', 'os_human'=>'FreeBSD 6', 'os_mod'=>'_6', 'arch'=>'x86', 'dirname'=>'freebsd_i386-6.2', 'us1-dir'=>'FreeBSD/v6/x86'); $platforms[] = array('os'=>'fre', 'os_human'=>'FreeBSD 6', 'os_mod'=>'_6', 'arch'=>'x86-64', 'dirname'=>'freebsd_amd64-6.1', 'us1-dir'=>'FreeBSD/v6/AMD64'); $platforms[] = array('os'=>'fre', 'os_human'=>'FreeBSD 7', 'os_mod'=>'_7', 'arch'=>'x86', 'dirname'=>'freebsd_i386-7.1', 'us1-dir'=>'FreeBSD/v7/x86'); $platforms[] = array('os'=>'fre', 'os_human'=>'FreeBSD 7', 'os_mod'=>'_7', 'arch'=>'x86-64', 'dirname'=>'freebsd_amd64-7.0', 'us1-dir'=>'FreeBSD/v7/AMD64'); $platforms[] = array('os'=>'fre', 'os_human'=>'FreeBSD 8', 'os_mod'=>'_8', 'arch'=>'x86', 'dirname'=>'freebsd_i386-8.0', 'us1-dir'=>'FreeBSD/v8/x86'); $platforms[] = array('os'=>'bsd', 'os_human'=>'BSDi', 'arch'=>'x86', 'dirname'=>'bsdi_i386-4.3.1'); $platforms[] = array('os'=>'bsd', 'os_human'=>'BSDi', 'arch'=>'x86', 'dirname'=>'bsdi_i386-4.3.1'); $platforms[] = array('os'=>'net', 'os_human'=>'NetBSD', 'arch'=>'x86', 'dirname'=>'netbsd_i386-2.1','us1-dir'=>'NetBSD/x86'); $platforms[] = array('os'=>'net', 'os_human'=>'NetBSD', 'arch'=>'x86-64', 'dirname'=>'netbsd_amd64-2.0','us1-dir'=>'NetBSD/x86_64'); $platforms[] = array('os'=>'ope', 'os_human'=>'OpenBSD 3.7', 'os_mod'=>'_3.7', 'arch'=>'x86-64', 'dirname'=>'openbsd_amd64-3.7'); $platforms[] = array('os'=>'ope', 'os_human'=>'OpenBSD 3.9', 'os_mod'=>'_3.9', 'arch'=>'x86-64', 'dirname'=>'openbsd_amd64-3.9'); $platforms[] = array('os'=>'ope', 'os_human'=>'OpenBSD 3.8', 'arch'=>'x86', 'dirname'=>'openbsd_i386-3.8', 'os_mod'=>'_3.8', 'us1-dir'=>'OpenBSD'); $platforms[] = array('os'=>'ope', 'os_human'=>'OpenBSD 4.2', 'arch'=>'x86', 'dirname'=>'openbsd_i386-4.2', 'os_mod'=>'_4.2', 'us1-dir'=>'OpenBSD'); $platforms[] = array('os'=>'ope', 'os_human'=>'OpenBSD 4.5', 'arch'=>'x86', 'dirname'=>'openbsd_i386-4.5', 'os_mod'=>'_4.5', 'us1-dir'=>'OpenBSD'); $platforms[] = array('os'=>'dar', 'os_human'=>'OS X', 'arch'=>'ppc', 'dirname'=>'osx_powerpc-8.5','us1-dir'=>'OSX/ppc'); $platforms[] = array('os'=>'dar', 'os_human'=>'OS X', 'arch'=>'x86', 'dirname'=>'osx_i386-8.11','us1-dir'=>'OSX/x86'); $platforms[] = array('os'=>'dar', 'os_human'=>'OS X', 'arch'=>'x86-64', 'dirname'=>'osx_x86-64-10.2','us1-dir'=>'OSX/x86_64'); $platforms[] = array('os'=>'sun', 'os_human'=>'Solaris', 'arch'=>'sparc', 'dirname'=>'solaris_sparc-5.9', 'us1-dir'=>'Solaris/sparc'); $platforms[] = array('os'=>'sun', 'os_human'=>'Solaris', 'arch'=>'x86', 'dirname'=>'solaris_i386-5.10','us1-dir'=>'Solaris/x86'); return $platforms; } function get_loader_platforms() { if (!isset($_SESSION['loader_platform_info'])) { $serialised_res = ''; $fp = @fopen(LOADER_PLATFORM_URL,'r'); if ($fp !== false) { $serialised_res = fgets($fp); } if (empty($serialised_res)) { $serialised_res = serialize(default_platform_list()); } $_SESSION['loader_platform_info'] = $serialised_res; } return unserialize($_SESSION['loader_platform_info']); } function get_platforminfo() { static $platforminfo; if (empty($platforminfo)) { $platforminfo = get_loader_platforms(); } return $platforminfo; } function supported_os_variants($os_code,$arch_code) { if (empty($os_code)) { return ERROR_UNKNOWN_OS; } if (empty($arch_code)) { return ERROR_UNKNOWN_ARCH; } $os_found = false; $arch_found = false; $os_arch_matches = array(); $pinfo = get_platforminfo(); foreach ($pinfo as $p) { if ($p['os'] == $os_code && $p['arch'] == $arch_code) { $os_arch_matches[$p['os_human']] = (isset($p['os_mod']))?str_replace('_','',$p['os_mod']):''; } if ($p['os'] == $os_code) { $os_found = true; } elseif ($p['arch'] == $arch_code) { $arch_found = true; } } if (!empty($os_arch_matches)) { asort($os_arch_matches); return $os_arch_matches; } elseif (!$os_found) { return ERROR_UNSUPPORTED_OS; } elseif (!$arch_found) { return ERROR_UNSUPPORTED_ARCH; } else { return ERROR_UNSUPPORTED_ARCH_OS; } } function supported_win_compilers() { static $win_compilers; if (empty($win_compilers)) { $win_compilers = find_win_compilers(); } return $win_compilers; } function find_win_compilers() { if (!isset($_SESSION['php_compilers_info'])) { $serialised_res = ''; $fp = @fopen(PHP_COMPILERS_URL,'r'); if ($fp !== false) { $serialised_res = fgets($fp); } if (empty($serialised_res)) { $serialised_res = serialize(array('VC6')); } $_SESSION['php_compilers_info'] = $serialised_res; } return unserialize($_SESSION['php_compilers_info']); } function server_software_info() { $ss = array('full' => '','short' => ''); $ss['full'] = $_SERVER['SERVER_SOFTWARE']; if (preg_match('/apache/i', $ss['full'])) { $ss['short'] = 'Apache'; } else if (preg_match('/IIS/',$ss['full'])) { $ss['short'] = 'IIS'; } else { $ss['short'] = ''; } return $ss; } function match_arch_pattern($str) { $arch = null; $arch_patterns = array( 'i.?86' => 'x86', 'x86[-_]64' => 'x86-64', 'x86' => 'x86', 'amd64' => 'x86-64', 'ppc64' => 'ppc64', 'ppc' => 'ppc', 'sparc' => 'sparc', 'sun' => 'sparc' ); foreach ($arch_patterns as $token => $a) { if (preg_match("/$token/i", $str)) { $arch = $a; break; } } return $arch; } function required_loader() { $un = php_uname(); $php_major_version = substr(PHP_VERSION,0,3); $os_name = substr($un,0,strpos($un,' ')); $os_code = empty($os_name)?'':strtolower(substr($os_name,0,3)); $wordsize = ((-1^0xffffffff) ? 64 : 32); if ($os_code == 'win') { $arch = ($wordsize == 32)?'x86':'x86-64'; if ($wordsize != 32) { return ERROR_WINDOWS_64_BIT; } } elseif (!empty($os_code)) { $arch = match_arch_pattern($un); } $os_variants = supported_os_variants($os_code,$arch); if (!is_array($os_variants)) { return $os_variants; } $os_ver = ''; if (preg_match('/([0-9.]+)/',php_uname('r'),$match)) { $os_ver = $match[1]; } $loader_sfix = (($os_code == 'win') ? 'dll' : 'so'); $file = "ioncube_loader_${os_code}_${php_major_version}.${loader_sfix}"; if ($os_code == 'win') { $os_name = 'Windows'; $file_ts = $file; } else { $os_names = array_keys($os_variants); $parts = explode(" ",$os_names[0]); $os_name = $parts[0]; $file_ts = "ioncube_loader_${os_code}_${php_major_version}_ts.${loader_sfix}"; } return array( 'arch' => $arch, 'oscode' => $os_code, 'osname' => $os_name, 'osvariants' => $os_variants, 'osver' => $os_ver, 'osver2' => preg_split('@\.@',$os_ver), 'file' => $file, 'file_ts' => $file_ts, 'wordsize' => $wordsize ); } function ic_system_info() { $thread_safe = null; $debug_build = null; $cgi_cli = false; $is_cgi = false; $is_cli = false; $php_ini_path = ''; $is_supported_compiler = true; $php_compiler = ''; ob_start(); phpinfo(INFO_GENERAL); $php_info = ob_get_contents(); ob_end_clean(); $breaker = (php_sapi_name() == 'cli')?'\n':''; $lines = explode($breaker,$php_info); foreach ($lines as $line) { if (preg_match('/command/i',$line)) { continue; } if (preg_match('/thread safety/i', $line)) { $thread_safe = (preg_match('/(enabled|yes)/i', $line) != 0); } if (preg_match('/debug build/i', $line)) { $debug_build = (preg_match('/(enabled|yes)/i', $line) != 0); } if (preg_match('~configuration file.*(| => |v">)([^ <]*)~i',$line,$match)) { $php_ini_path = $match[2]; if (!@file_exists($php_ini_path)) { $php_ini_path = ''; } } if (preg_match('/compiler/i',$line)) { $supported_match = join('|',supported_win_compilers()); $is_supported_compiler = preg_match("/($supported_match)/i",$line); if (!$is_supported_compiler) { if (preg_match("/(VC[0-9]+)/i",$line,$match)) { $php_compiler = $match[1]; } } } } $is_cgi = strpos(php_sapi_name(),'cgi') !== false; $is_cli = strpos(php_sapi_name(),'cli') !== false; $cgi_cli = $is_cgi || $is_cli; $ss = server_software_info(); if (!$php_ini_path && function_exists('php_ini_loaded_file')) { $php_ini_path = php_ini_loaded_file(); if ($php_ini_path === false) { $php_ini_path = ''; } } $php_ini_basename = basename($php_ini_path); return array( 'THREAD_SAFE' => $thread_safe, 'DEBUG_BUILD' => $debug_build, 'PHP_INI' => $php_ini_path, 'PHP_INI_BASENAME' => $php_ini_basename, 'CGI_CLI' => $cgi_cli, 'IS_CGI' => $is_cgi, 'IS_CLI' => $is_cli, 'PHP_COMPILER' => $php_compiler, 'SUPPORTED_COMPILER' => $is_supported_compiler, 'FULL_SS' => $ss['full'], 'SS' => $ss['short']); } function is_possibly_dedicated_or_local() { $sys = get_sysinfo(); return (empty($sys['PHP_INI']) || !file_exists($sys['PHP_INI']) || (is_readable($sys['PHP_INI']) && (0 !== strpos($sys['PHP_INI'],$_SERVER['DOCUMENT_ROOT'])))); } function is_local() { $ret = false; if ($_SERVER["SERVER_NAME"] == 'localhost') { $ret = true; } else { $ip_address = strtolower($_SERVER["REMOTE_ADDR"]); if (strpos(':',$ip_address) === false) { $ip_parts = explode('.',$ip_address); $ret = (($ip_parts[0] == 10) || ($ip_parts[0] == 172 && $ip_parts[1] >= 16 && $ip_parts[1] <= 31) || ($ip_parts[0] == 192 && $ip_parts[1] == 168)); } else { $ret = ($ip_address == '::1') || (($ip_address[0] == 'f') && ($ip_address[1] >= 'c' && $ip_address[1] <= 'f')); } } return $ret; } function is_shared() { return !is_local() && !is_possibly_dedicated_or_local(); } function get_sysinfo() { static $sysinfo; if (empty($sysinfo)) { $sysinfo = ic_system_info(); } return $sysinfo; } function get_loaderinfo() { static $loader; if (empty($loader)) { $loader = required_loader(); } return $loader; } function is_ms_windows() { $loader_info = get_loaderinfo(); return ($loader_info['oscode'] == 'win'); } function function_is_disabled($fn_name) { $disabled_functions=explode(',',ini_get('disable_functions')); return in_array($fn_name, $disabled_functions); } function threaded_and_not_cgi() { $sys = get_sysinfo(); return($sys['THREAD_SAFE'] && !$sys['IS_CGI']); } function own_php_ini_possible() { $sysinfo = get_sysinfo(); return ($sysinfo['CGI_CLI'] && !is_ms_windows()); } function extension_dir_path() { $extdir = ini_get('extension_dir'); if ($extdir == './') { $extdir = '.'; } return realpath($extdir); } function get_loader_name() { $u = php_uname(); $os = substr($u,0,strpos($u,' ')); $os_key = strtolower(substr($u,0,3)); $php_version = phpversion(); $php_family = substr($php_version,0,3); $loader_sfix = (($os_key == 'win') ? '.dll' : '.so'); $loader_name="ioncube_loader_${os_key}_${php_family}${loader_sfix}"; return $loader_name; } function get_reqd_version_fre() { $max_version_built = 7; $min_version_built = 4; $req_version = 0; $exact_match = false; $loader_info = get_loaderinfo(); $osv = $loader_info['osver2']; $arch = $loader_info['arch']; if ($osv[0] >= $min_version_built && !(6 > $osv[0] && $arch == 'x86-64')) { if ($osv[0] > $max_version_built) { $req_version = $max_version_built; } elseif (5 == $osv[0]) { $req_version = 4; } else { $exact_match = true; $req_version = $osv[0]; } } return (array($req_version,$exact_match)); } function get_reqd_version_ope() { $max_version_built_32 = 4.5; $max_version_built_64 = 3.9; $min_version_built_32 = 3.8; $min_version_built_64 = 3.7; $req_version = 0; $exact_match = false; $loader_info = get_loaderinfo(); $osv = $loader_info['osver2'][0] . "." . $loader_info['osver2'][1]; $arch = $loader_info['arch']; $max_version_built = ($arch == 'x86-64')?$max_version_built_64:$max_version_built_32; $min_version_built = ($arch == 'x86-64')?$min_version_built_64:$min_version_built_32; if ($osv >= $min_version_built) { if ($osv > $max_version_built) { $req_version = $max_version_built; } elseif (3.8 == $osv && $arch == 'x86-64') { $req_version = 3.7; } elseif ($osv < 4.2 && $arch == 'x86') { $req_version = 3.8; } elseif ($osv > 4.0 && $osv < $max_version_built) { $req_version = 4.2; } else { $exact_match = true; $req_version = $osv[0]; } } return (array($req_version,$exact_match)); } function get_reqd_version($variants) { $exact_match = false; $nearest_version = 0; $loader_info = get_loaderinfo(); $os_version = $loader_info['osver2'][0] . '.' . $loader_info['osver2'][1]; foreach ($variants as $v) { if ($v == $os_version) { $exact_match = true; $nearest_version = $v; break; } elseif ($v > $os_version) { break; } else { $nearest_version = $v; } } return (array($nearest_version,$exact_match)); } function get_default_loader_dir() { return ($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . LOADER_SUBDIR); } function get_loader_location($loader_dir = '') { if (empty($loader_dir)) { $loader_dir = get_default_loader_dir(); } $loader_name = get_loader_name(); return ($loader_dir . DIRECTORY_SEPARATOR . $loader_name); } function get_loader_location_from_ini($php_ini = '') { if (empty($php_ini)) { $sysinfo = get_sysinfo(); $php_ini = $sysinfo['PHP_INI']; } $lines = file($php_ini); $ext_start = zend_extension_line_start(); $wrong_ext_start = ($ext_start == 'zend_extension')?'zend_extension_ts':'zend_extension'; $first_ext = true; $loader_path = ''; foreach ($lines as $l) { if (preg_match("/^\s*$ext_start\s*=\s*\"?([^\"]+)\"?/i",$l,$corr_matches)) { if (preg_match("/ioncube/i",$corr_matches[1])) { if ($first_ext !== true) { $errors[] = "The ionCube Loader must be the first zend_extension listed in the configuration file, $php_ini."; } $loader_path = $corr_matches[1]; break; } else { $first_ext = false; } } if (preg_match("/^\s*$wrong_ext_start\s*=\s*\"?([^\"]+)\"?/i",$l,$bad_start_matches)) { if (preg_match("/ioncube/i",$bad_start_matches[1])) { $bad_zend_ext_msg = "The line for the ionCube Loader in the configuration file, $php_ini, should start with $ext_start and not $wrong_ext_start."; $errors[] = $bad_zend_ext_msg; } $loader_path = $bad_start_matches[1]; } } $loader_path = trim($loader_path); if ($loader_path == '') { $errors[] = "The necessary zend_extension line could not be found in the configuration file, $php_ini."; } elseif (!file_exists($loader_path)) { $errors[] = "The Loader file $loader_path, listed in the configuration file, $php_ini, does not exist."; } elseif (basename($loader_path) == $loader_path) { $errors[] = "A full path must be specified for the loader file in the configuration file, $php_ini."; } if (empty($errors)) { return $loader_path; } else { return $errors; } } function find_loader() { $sysinfo = get_sysinfo(); $php_ini = $sysinfo['PHP_INI']; if (is_readable($php_ini)) { return get_loader_location_from_ini($php_ini); } else { $loader_name = get_loader_name(); if (file_exists($loader_name)) { return $loader_name; } else { $ld_loc = get_loader_location(); if (file_exists($ld_loc)) { return $ld_loc; } else { if (!file_exists($php_ini)) { return array('Loader could not be found - php.ini file does not exist.'); } else { return array('Loader could not be found - unsuccessfully tried reading php.ini.'); } } } } } function zend_extension_line_start() { $sysinfo = get_sysinfo(); $is_53_or_later = is_php_version_or_greater(5,3); return (is_bool($sysinfo['THREAD_SAFE']) && $sysinfo['THREAD_SAFE'] && !$is_53_or_later ? 'zend_extension_ts' : 'zend_extension'); } function ioncube_loader_version_information() { $old_version = true; $liv = ""; if (function_exists('ioncube_loader_iversion')) { $liv = ioncube_loader_iversion(); $lv = sprintf("%d.%d.%d", $liv / 10000, ($liv / 100) % 100, $liv % 100); if ($liv >= get_latestversion()) { $old_version = false; } } return array($lv,$old_version); } function get_loader_version_info() { if (!isset($_SESSION['loader_version_info'])) { $serialised_res = ''; $fp = @fopen(LOADER_LATEST_VERSIONS_URL,'r'); if ($fp !== false) { $serialised_res = fgets($fp); } if (empty($serialised_res)) { $serialised_res = serialize(array()); } $_SESSION['loader_version_info'] = $serialised_res; } return unserialize($_SESSION['loader_version_info']); } function calc_loader_latest_version() { $lv_info = get_loader_version_info(); if (empty($lv_info)) { return RECENT_LOADER_VERSION; } else { $platform_info = get_platforminfo(); $loader = get_loaderinfo(); if (count($loader['osvariants']) > 1) { list($osvar,$exact_match) = get_reqd_version($loader['osvariants']); } else { $osvar = null; } $dirname = ''; foreach ($platform_info as $p) { if ($p['os'] == $loader['oscode'] && $p['arch'] == $loader['arch'] && (empty($osvar) || $p['os_mod'] == "_" . $osvar)) { $dirname = $p['dirname']; break; } } if (!empty($dirname) && array_key_exists($dirname,$lv_info)) { return $lv_info[$dirname]; } else { return RECENT_LOADER_VERSION; } } } function get_latestversion() { static $latest_version; if (empty($latest_version)) { $latest_version = calc_loader_latest_version(); } return $latest_version; } function runtime_loader_location() { $loader_path = false; $ext_path = extension_dir_path(); if ($ext_path !== false) { $id = $ext_path; $here = dirname(__FILE__); if (isset($id[1]) && $id[1] == ':') { $id = str_replace('\\','/',substr($id,2)); $here = str_replace('\\','/',substr($here,2)); } if (!is_php_version_or_greater(5,2,5)) { $rd=str_repeat('/..',substr_count($id,'/')).$here.'/'; $i=strlen($rd); $loader_loc = DIRECTORY_SEPARATOR . basename($here) . DIRECTORY_SEPARATOR . get_loader_name(); while($i--) { if($rd[$i]=='/') { $loader_path = runtime_location_exists($ext_path,$rd,$i,$loader_loc); if ($loader_path !== false) { break; } } } } else { $loader_loc = ''; } if (!$loader_path && !empty($loader_loc) && @file_exists($loader_loc)) { $loader_path = basename($loader_loc); } } return $loader_path; } function runtime_location_exists($ext_dir,$path_str,$sep_pos,$loc_name) { $sub_path = substr($path_str,0,$sep_pos); $lp = $sub_path . $loc_name; $fqlp = $ext_dir.$lp; if(@file_exists($fqlp)) { return $lp; } else { return false; } } function runtime_loading_is_possible() { return !(is_php_version_or_greater(5,2,5) || ini_get('safe_mode') || !ini_get('enable_dl') || !function_exists('dl') || function_is_disabled('dl') || threaded_and_not_cgi()); } function get_valid_runtime_loading_path($ignore_loading_check = false) { if ($ignore_loading_check || runtime_loading_is_possible()) { return runtime_loader_location(); } else { return false; } } function runtime_loading() { $rtl_path = get_valid_runtime_loading_path(); if ($rtl_path !== false && @dl($rtl_path)) { return $rtl_path; } else { return false; } } function runtime_loading_instructions() { echo '

Runtime Loading Instructions

'; echo '
'; echo '
    '; loader_download_instructions(); $loader_dir = loader_install_instructions(SERVER_SHARED,dirname(__FILE__)); shared_test_instructions(); echo '
'; echo '
'; } function runtime_loading_errors() { $errors = array(); $ext_path = extension_dir_path(); if (false === $ext_path) { $errors[] = "Extensions directory cannot be found."; } else { $expected_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . get_loader_name(); if (!file_exists($expected_file)) { $errors[] = "The Loader file was expected to be at $expected_file but could not be found."; } else { $errors = loader_compatibility_test($expected_file); } } return $errors; } function loader_download_instructions() { $sysinfo = get_sysinfo(); $loader = get_loaderinfo(); $multiple_os_versions = false; if (is_ms_windows()) { if (is_bool($sysinfo['THREAD_SAFE'])) { if ($sysinfo['THREAD_SAFE']) { echo '
  • Download one of the following archives of Windows x86 Loaders:'; $basename = LOADERS_PACKAGE_PREFIX . 'win_x86'; } else { $basename = LOADERS_PACKAGE_PREFIX . 'win_nonts_x86'; echo '
  • Download one of the following archives of Windows non-TS x86 Loaders:'; } echo make_archive_list($basename,array('zip','ipf.zip')); echo "

    Please note that the MS Windows installer version is suitable either for direct installation on a Windows machine or for uploading from a local PC to your server.
    "; echo 'A Loaders archive can also be downloaded from ' . LOADERS_PAGE . '.'; } else { echo '

  • Download a Windows Loaders archive from here. If PHP is built with thread safety disabled, use the Windows non-TS Loaders.'; } } else { $multiple_os_versions = count($loader['osvariants']) > 1; if ($multiple_os_versions) { list($reqd_version,$exact_match) = get_reqd_version($loader['osvariants']); if ($reqd_version) { $basename = LOADERS_PACKAGE_PREFIX . $loader['oscode'] . '_' . $reqd_version . '_' . $loader['arch']; } else { $basename = ""; } } else { $basename = LOADERS_PACKAGE_PREFIX . $loader['oscode'] . '_' . $loader['arch']; } if ($basename == "") { echo '
  • Download a ' . $loader['osname'] . ' ' . $loader['arch'] . ' Loaders archive from here.'; echo "
    Your system appears to be ${loader['osname']} ${osv[0]} for ${loader['wordsize']} bit. If Loaders are not available for that exact release of ${loader['osname']}, Loaders built for an earlier release should work. Note that you may need to install back compatibility libraries for the operating system."; echo '
    If you cannot find a suitable loader then please raise a ticket at our support helpdesk.'; } else { echo '
  • Download one of the following archives of Loaders for ' . $loader['osname'] . ' ' . $loader['arch'] . ':'; echo make_archive_list($basename,array('tar.gz','tar.bz2','ipf.zip')); echo "

    Please note that the MS Windows installer version is suitable for uploading from a Windows PC to your ${loader['osname']} server.
    "; echo "

    "; if ($multiple_os_versions && !$exact_match) { echo "

    Note that you may need to install back compatibility libraries for ${loader['osname']}.

    "; } } } echo '
  • '; } function loader_install_instructions($server_type,$loader_dir = '') { if (empty($loader_dir)) { if (SERVER_SHARED_INI == $server_type) { $loader_dir = get_default_loader_dir(); } else { if (is_ms_windows()) { $sysinfo = get_sysinfo(); if ($sysinfo['SS'] == 'IIS') { if (false === ($ext_dir = extension_dir_path())) { $loader_dir = $_SERVER['windir'] . '\\' . WINDOWS_IIS_LOADER_DIR; } else { $loader_dir = $ext_dir; } } else { if (!empty($sysinfo['PHP_INI'])) { $parent_dir = dirname($sysinfo['PHP_INI']); } else { $parent_dir = $_SERVER["PHPRC"]; } $loader_dir = $parent_dir . '\\' . 'ioncube'; } } else { $loader_dir = UNIX_SYSTEM_LOADER_DIR; } } } if (SERVER_LOCAL == $server_type) { echo "
  • Put the Loader files in $loader_dir
  • "; } else { echo "
  • Transfer the Loaders to your web server and install in $loader_dir
  • "; } return $loader_dir; } function zend_extension_instructions($server_type,$loader_dir) { $sysinfo = get_sysinfo(); $qt = (is_ms_windows()?'"':''); $loader = get_loaderinfo(); $php_ini_name = ini_file_name(); if (is_bool($sysinfo['THREAD_SAFE'])) { $kwd = zend_extension_line_start(); } else { $kwd = 'zend_extension/zend_extension_ts'; } if (!empty($sysinfo['PHP_INI'])) { if (SERVER_SHARED_INI == $server_type) { $html_dir = $_SERVER['DOCUMENT_ROOT']; $ini_path = $html_dir . "/" . $php_ini_name; if (file_exists($ini_path)) { echo "
  • Edit the $php_ini_name in your $html_dir directory and add the following line to the top of the file:
    " . $zend_extension_line; } else { echo "
  • Save this $php_ini_name file and upload it to your html directory, $html_dir"; } } else { echo "
  • Edit the file ${sysinfo['PHP_INI']}"; } } else { echo "
  • Edit the system $php_ini_name file"; } echo " and before any other $kwd lines add:
    "; if (!is_bool($sysinfo['THREAD_SAFE']) || !$sysinfo['THREAD_SAFE']) { $path = $qt . $loader_dir . DIRECTORY_SEPARATOR . $loader['file'] . $qt; echo "zend_extension = $path
    "; } if (!is_bool($sysinfo['THREAD_SAFE']) || $sysinfo['THREAD_SAFE']) { $line_start = zend_extension_line_start(); $path = $qt . $loader_dir . DIRECTORY_SEPARATOR . $loader['file_ts'] . $qt; echo "$line_start = $path
    "; } echo '
  • '; } function server_restart_instructions() { $sysinfo = get_sysinfo(); $self = get_self(); if ($sysinfo['SS']) { echo "
  • Restart the ${sysinfo['SS']} server software.
  • "; } else { echo "
  • Restart the server software.
  • "; } echo "
  • When the server software has restarted, click here to test the Loader.
  • "; if ($sysinfo['SS'] == 'Apache' && !is_ms_windows()) { echo '
  • If the Loader installation failed, check the Apache error log file for errors and see our guide to Unix related errors.
  • '; } } function shared_test_instructions() { $self = get_self(); echo "
  • Click here to test the Loader.
  • "; } function php_ini_instruction_list($server_type) { echo '

    Installation Instructions

    '; echo '
    '; echo '
      '; loader_download_instructions(); $loader_dir = loader_install_instructions($server_type); zend_extension_instructions($server_type,$loader_dir); if ($server_type != SERVER_SHARED_INI) { server_restart_instructions(); } else { shared_test_instructions(); } echo '
    '; echo '
    '; } function php_ini_install_shared($give_preamble = true) { $php_ini_name = ini_file_name(); $server_type = SERVER_SHARED; $self = get_self(); if ($give_preamble) { echo "

    On your shared server, the Loader must be installed using a $php_ini_name configuration file."; echo " (Please click here if you are not on a shared server.)

    "; } if (own_php_ini_possible()) { $server_type = SERVER_SHARED_INI; echo '

    With your hosting account, you may be able to use your own PHP configuration file.

    '; } else { echo "

    It appears that you do not have access to the $php_ini_name file. Your server provider or system administrator should be able to perform the installation for you. Please refer them to the following instructions.

    "; } php_ini_instruction_list($server_type); } function php_ini_install($server_type_desc = null, $server_type = SERVER_DEDICATED, $required = true) { $php_ini_name = ini_file_name(); $self = get_self(); echo '

    '; if ($server_type_desc) { echo "For a $server_type_desc server "; } else { echo "For this server "; } if ($required) { echo "you should install the ionCube Loader using the $php_ini_name configuration file."; } else { echo "installing the ionCube Loader using the $php_ini_name file is recommended."; } if ($server_type_desc) { echo " (Please click here if you are not on a $server_type_desc server.)"; } echo '

    '; php_ini_instruction_list($server_type); } function php_ini_contents($loader_location) { $dbq = (is_ms_windows())?'"':''; $line = zend_extension_line_start() . ' = ' . $dbq . $loader_location . $dbq; return $line; } function help_resources($error_list = array()) { return (array( 'ionCube Loaders FAQ', 'ionCube Loader Forum', 'Raise a support ticket through our helpdesk')); } function support_ticket_information($error_list = array()) { $sys = get_sysinfo(); $ld = get_loaderinfo(); $ticket_strs = array(); $ticket_strs[] = "PLEASE DO NOT REMOVE THE FOLLOWING INFORMATION\r\n"; $ticket_strs[] = "==============\r\n"; if (!empty($error_list)) { $ticket_strs[] = "[hr]"; $ticket_strs[] = "ERRORS"; $ticket_strs[] = "[table]"; $ticket_strs[] = '[tr][td]' . join('[/td][/tr][tr][td]',$error_list) . '[/td][/tr]'; $ticket_strs[] = "[/table]"; } $ticket_strs[] = "[hr]"; $ticket_strs[] = "SYSTEM INFORMATION"; $ticket_strs[] = "[table]"; $info_lines = array(); $info_lines["Machine architecture"] = $ld['arch']; $info_lines["Operating system"] = $ld['osname'] . ' ' . $ld['osver']; $info_lines["PHP version"] = PHP_VERSION; if (!$sys['SUPPORTED_COMPILER']) { $info_lines["SUPPORTED PHP COMPILER"] = "FALSE"; $info_lines["PHP COMPILER"] = $sys['PHP_COMPILER']; } $info_lines["Is CLI?"] = ($sys['IS_CLI']?"Yes":"No"); $info_lines["Is CGI?"] = ($sys['IS_CGI']?"Yes":"No"); $info_lines["Is thread-safe?"] = ($sys['THREAD_SAFE']?"Yes":"No"); $info_lines["Web server"] = $sys['FULL_SS']; $info_lines[ "PHP ini file"] = $sys['PHP_INI']; if (!file_exists($sys['PHP_INI'])) { $info_lines["Ini file found"] = "INI FILE NOT FOUND"; } else { if (is_readable($sys['PHP_INI'])) { $info_lines["Ini file found"] = "INI FILE READABLE"; } else { $fh = fopen($sys['PHP_INI'],"rb"); if ($fh === false) { $info_lines["Ini file found"] = "INI FILE FOUND BUT POSSIBLY NOT READABLE"; } else { $info_lines["Ini file found"] = "INI FILE READABLE"; } } } $loader_path = find_loader(); if (is_string($loader_path)) { $info_lines["Loader path"] = $loader_path; $info_lines["Loader MD5 sum"] = md5_file($loader_path); } else { $info_lines["Loader path"] = "LOADER PATH NOT FOUND"; } $info_lines["Wizard script path"] = '[url]http://' . $_SERVER["HTTP_HOST"] . get_self() . '[/url]'; foreach ($info_lines as $h => $i) { $ticket_strs[] = '[tr][td]' . $h . '[/td]' . '[td]' . $i . '[/td][/tr]'; } $ticket_strs[] = '[/table]'; $ticket_strs[] = '[hr]'; $ticket_strs[] = "\r\n==============\r\n"; $ticket_strs[] = "PLEASE ENTER ANY ADDITIONAL INFORMATION BELOW\r\n"; $support_ticket_str = join('',$ticket_strs); return rawurlencode($support_ticket_str); } function os_arch_string_check($loader_str) { $errors = array(); if (preg_match("/target os:\s*([^_]+)_(.*)-/i",$loader_str,$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'] != ($ap = match_arch_pattern($os_matches[2]))) { $err_str = "You have the wrong loaders for your machine architecture."; $err_str .= " Your system is " . $loader_info['arch']; $err_str .= " but the loader you are using is for " . $ap . "."; $errors[] = $err_str; } } return $errors; } 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 ($installed_loader_name) does not have the name expected ($expected_loader_name) 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 .= "
    Please check that it exists and is readable."; $execute_error .= "
    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 .= "
    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 PHP $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."; } $errors = array_merge($errors,os_arch_string_check($loader_strs)); return $errors; } function shared_server() { if (!$rtl_path = runtime_loading()) { if (empty($_SESSION['use_ini_method']) && runtime_loading_is_possible()) { runtime_loading_instructions(); } else { php_ini_install_shared(); } } else { if (is_string($rtl_path)) { echo "

    The loader has been successfully installed by runtime loading using dl($rtl_path)

    "; } else { echo "

    The loader has been successfully installed.

    "; } } } function dedicated_server() { php_ini_install('dedicated or VPS', SERVER_DEDICATED, true); } function local_install() { php_ini_install('local',SERVER_LOCAL, true); } function unregister_globals() { if (!ini_get('register_globals')) { return; } if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS'])) { die('GLOBALS overwrite attempt detected'); } $noUnset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES'); $input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, isset($_SESSION) && is_array($_SESSION) ? $_SESSION : array()); foreach ($input as $k => $v) { if (!in_array($k, $noUnset) && isset($GLOBALS[$k])) { unset($GLOBALS[$k]); } } } function run() { unregister_globals(); if (is_php_version_or_greater(4,3,0)) { ini_set('session.use_only_cookies',1); } @session_start(); if (!isset($_SESSION['CREATED'])) { $_SESSION['CREATED'] = time(); } elseif (time() - $_SESSION['CREATED'] > SESSION_LIFETIME_MINUTES * 60) { $persist['not_go_daddy'] = empty($_SESSION['not_go_daddy'])?0:1; $persist['use_ini_method'] = empty($_SESSION['use_ini_method'])?0:1; $persist['on_shared_host'] = empty($_SESSION['on_shared_host'])?0:1; session_destroy(); $_SESSION = array(); $_SESSION = $persist; } if (!isset($_SERVER)) $_SERVER =& $HTTP_SERVER_VARS; (php_sapi_name() == 'cli') && die("This script should only be run by a web server.\n"); $page = get_request_parameter('page'); $host = get_request_parameter('host'); $clear = get_request_parameter('clear'); $ini = get_request_parameter('ini'); if (!empty($host)) { if ($host == 'ngd') { $_SESSION['not_go_daddy'] = 1; } } if (!empty($ini)) { $_SESSION['use_ini_method'] = 1; } if (!empty($clear)) { unset($_SESSION['latest_version']); unset($_SESSION['loader_platform_info']); unset($_SESSION['loader_version_info']); unset($_SESSION['php_compilers_info']); unset($_SESSION['not_go_daddy']); unset($_SESSION['use_ini_method']); unset($_SESSION['on_shared_host']); } if (empty($_SESSION['latest_version'])) { $_SESSION['latest_version'] = retrieve_latest_version(); } if (!empty($page)) { $fn = "${page}_page"; if (function_exists($fn)) { $fn(); } else { default_page(); } } else { $godaddy_root = GoDaddy_root(); if (empty($godaddy_root)) { default_page(); } else { GoDaddy_page($godaddy_root); } } @session_write_close(); exit(0); } function default_page($loader_extension = LOADER_EXTENSION_NAME) { $self = get_self(); foreach (array('self') as $vn) { if (empty($$vn)) { error("Unable to initialise ($vn)."); } } heading(); $wizard_update = check_for_wizard_update(true); if (extension_loaded($loader_extension)) { loader_already_installed(); } else { loader_not_installed(); } footer($wizard_update); } function uninstall_wizard_instructions() { echo '

    For security reasons we advise that you remove this Wizard script from your server now that the Loader is installed.

    '; } function contact_script_provider_instructions() { echo '

    Please contact the script provider if you do experience any problems running encoded files.

    '; } function loader_already_installed() { list($lv,$old_version) = ioncube_loader_version_information(); echo "

    "; if ($old_version) { echo 'The ionCube Loader ' . $lv . ' is already installed but it is an old version. It is recommended that the Loader be updated to the latest version from the ionCube Loaders page if one is available for your platform.

    '; } else { echo 'The ionCube Loader ' . $lv . ' is already installed and encoded files should run without problems.'; } echo "

    "; contact_script_provider_instructions(); uninstall_wizard_instructions(); } function loader_not_installed() { $loader = get_loaderinfo(); $sysinfo = get_sysinfo(); $stype = get_request_parameter('stype'); $manual_select = get_request_parameter('manual'); if (isset($stype)) { $_SESSION['on_shared_host'] = $stype == 's'; } elseif (!isset($_SESSION['on_shared_host'])) { $_SESSION['on_shared_host'] = is_shared(); } if (!$manual_select && empty($_SESSION['use_ini_method']) && $_SESSION['on_shared_host'] && runtime_loading_is_possible()) { $errors = runtime_loading_errors(); } else { $errors = ini_loader_errors(); } if (!empty($errors)) { if (count($errors) > 1) { $problem_str = "Please note that the following problems currently exist"; } else { $problem_str = "Please note that the following problem currently exists"; } echo '
    ' .$problem_str . ' with the Loader installation:'; echo make_list($errors,"ul"); echo '
    '; } if (!isset($stype)) { echo '

    To use files that have been protected by the ionCube PHP Encoder, a component called the ionCube Loader must be installed.

    '; } if (!is_array($loader)) { if ($loader == ERROR_WINDOWS_64_BIT) { echo '

    Loaders for 64-bit PHP on Windows are not currently available. However, if you install and run 32-bit PHP the corresponding 32-bit Loader for Windows should work.

    '; if ($sysinfo['THREAD_SAFE']) { echo '
  • Download one of the following archives of 32-bit Windows x86 Loaders:'; $basename = LOADERS_PACKAGE_PREFIX . 'win_x86'; } else { $basename = LOADERS_PACKAGE_PREFIX . 'win_nonts_x86'; echo '
  • Download one of the following archives of 32-bit Windows non-TS x86 Loaders:'; } echo make_archive_list($basename); } else { echo '

    There may not be a Loader available for your type of system at the moment, however if you create a support ticket more advice and information may be available to assist. Please include the URL for this Wizard in your ticket.

    '; } } else { if (!is_supported_php_version()) { echo '

    Your server is running PHP version ' . PHP_VERSION . ' and is unsupported by ionCube Loaders. Recommended PHP 4 versions are PHP 4.2 or higher, and PHP 5.1 or higher for PHP 5.

    '; } elseif (!$sysinfo['SUPPORTED_COMPILER']) { $supported_compilers = supported_win_compilers(); $supported_compiler_string = join('/',$supported_compilers); echo '

    At the current time the ionCube Loader requires PHP to be built with ' . $supported_compiler_string . '. Your PHP software has been built using ' . $sysinfo['PHP_COMPILER'] . '. Supported builds of PHP are available from PHP.net.'; } else { if (!in_array($stype,array('s','d','l'))) { if (!$manual_select && is_local()) { local_install(); } elseif (!$manual_select && !is_possibly_dedicated_or_local()) { shared_server(); } else { echo server_selection_form(); } } else { switch ($stype) { case 's': shared_server(); break; case 'd': dedicated_server(); break; case 'l': local_install(); break; } } } } } function server_selection_form() { $self = get_self(); $form = <<This Wizard will give you information on how to install the Loader.

    Please select the type of web server that you have and then click Next.



    EOT; return $form; } function phpinfo_page() { phpinfo(); } function loader_check_page($ext_name = LOADER_EXTENSION_NAME) { heading(); $rtl_path = null; if (empty($_SESSION['use_ini_method']) && !empty($_SESSION['on_shared_host']) && runtime_loading_is_possible()) { $rtl_path = runtime_loading(); } if (extension_loaded($ext_name)) { list($lv,$is_old) = ioncube_loader_version_information(); echo '

    The ionCube Loader ' . $lv . ' is installed and encoded files should run successfully.

    '; contact_script_provider_instructions(); uninstall_wizard_instructions(); } else { echo '

    The ionCube Loader is not currently installed successfully.

    '; if (!is_null($rtl_path)) { echo '

    Runtime loading was attempted but has failed.

    '; $rt_errors = runtime_loading_errors(); if (!empty($rt_errors)) { list_loader_errors($rt_errors); } else { $self = get_self(); echo "

    Please click here for instructions on using the php.ini method instead.

    "; } } else { list_loader_errors(); } } footer(true); } function ini_loader_errors() { $errors = array(); $loader_loc = find_loader(); if (is_string($loader_loc)) { $errors = loader_compatibility_test($loader_loc); } else { $errors = $loader_loc; } return $errors; } function list_loader_errors($errors = array(),$suggest_restart = true) { $self = get_self(); $retry_message = ''; if (empty($errors)) { $errors = ini_loader_errors(); } if (!empty($errors)) { $try_again = 'try again'; echo '
    '; if (count($errors) > 1) { echo 'The following problems have been found with the Loader installation:'; $retry_message = "Please correct those errors and $try_again."; } else { echo 'The following problem has been found with the Loader installation:'; $retry_message = "Please correct that error and $try_again."; } echo make_list($errors,"ul"); echo '
    '; } elseif ($suggest_restart) { $sysinfo = get_sysinfo(); $ss = $sysinfo['SS']; echo "

    Please check that the $ss web server software has been restarted.

    "; } echo '
    '; echo $retry_message; echo " You may wish to view the following for further help:"; echo make_list(help_resources($errors),"ul"); echo 'Click here to go back to the start of the Loader Wizard.
    '; } function phpini_page() { if (empty($loader_dir)) { $loader_dir = get_default_loader_dir(); } $loader_name = get_loader_name(); $loader_loc = $loader_dir . "/" . $loader_name; $loader_loc = get_loader_location(get_request_parameter('ldpath')); header('Content-Type: text/plain'); header('Content-Disposition: attachment; filename='. ini_file_name()); echo php_ini_contents($loader_loc); } function phpconfig_page() { $sys = get_sysinfo(); if (isset($sys['PHP_INI']) && file_exists($sys['PHP_INI'])) { header('Content-Type: text/plain'); @readfile($sys['PHP_INI']); } else { echo "php.ini file could not be read."; } } function extra_page() { heading(); $loader_path = find_loader(); echo "

    Additional Information

    "; echo "

    "; if (is_string($loader_path)) { echo "Loader is at " . $loader_path; echo "
    MD5 sum is " . md5_file($loader_path); if (0 === strpos($loader_path,$_SERVER['DOCUMENT_ROOT'])) { $s = strlen($_SERVER['DOCUMENT_ROOT']); $loader_url = 'http://' . $_SERVER["HTTP_HOST"] . preg_replace('@\\\\@','/',substr($loader_path,$s)); echo "
    Download Loader from $loader_url"; } else { echo "
    Loader is not within the document root at " . $_SERVER['DOCUMENT_ROOT']; } } else { echo "Loader cannot be found"; } echo "

    "; footer(true); } function GoDaddy_root($html_root = '') { $godaddy_root = ''; if (empty($html_root)) { $html_root = $_SERVER['DOCUMENT_ROOT']; } if (empty($_SESSION['not_go_daddy'])) { $godaddy_pattern = "[\\/]home[\\/]content[\\/][0-9a-z][\\/][0-9a-z][\\/][0-9a-z][\\/][0-9a-z]+[\\/]html"; if (preg_match("@$godaddy_pattern@i",$html_root,$matches)) { $godaddy_root = $matches[0]; } } return $godaddy_root; } function GoDaddy_windows_instructions() { $instr = "It appears that you are hosted on a Windows server at GoDaddy.
    "; $instr .= "Please change to a Linux hosting plan at GoDaddy.
    "; $instr .= "If you contact their support team they should be able to switch you to a Linux server."; echo $instr; } function GoDaddy_linux_instructions($html_dir) { $self = get_self(); $loader_name = get_loader_name(); $zend_extension_line="zend_extension = $html_dir/ioncube/$loader_name"; $ini_path = $html_dir . "/php5.ini"; $instr = array(); $instr[] = 'In your html directory, ' . $html_dir . ', create a sub-directory called ioncube.'; if (file_exists($ini_path)) { $instr[] = "Edit the php5.ini in your $html_dir and add the following line to the top of the file:
    " . $zend_extension_line ; } else { $instr[] = "Save this php5.ini file and upload it to your html directory, $html_dir"; } $instr[] = 'Download the Linux Loaders.'; $instr[] = 'Unzip the loaders and upload them into the ioncube directory you created previously.'; $instr[] = 'The encoded files should now be working.'; echo '
    '; echo (make_list($instr)); echo '
    '; } function GoDaddy_page($home_dir) { $self = get_self(); heading(); $inst_str = '

    GoDaddy Installation Instructions

    '; $inst_str .= '

    It appears that you are hosted with GoDaddy (www.godaddy.com). '; $inst_str .= "If that is not the case then please click here to go to the main page of this installation wizard.

    "; $inst_str .= "

    If you have already installed the loader then please click here to test the Loader.

    "; echo $inst_str; if (is_ms_windows()) { GoDaddy_windows_instructions(); } else { GoDaddy_linux_instructions($home_dir); } footer(true); } function get_request_parameter($param_name) { static $request_array; if (!isset($request_array)) { if (isset($_GET)) { $request_array = $_GET; } elseif (isset($HTTP_GET_VARS)) { $request_array = $HTTP_GET_VARS; } } if (isset($request_array[$param_name])) { return $request_array[$param_name]; } else { return null; } } function make_list($list_items,$list_type='ol') { $html = ''; if (!empty($list_items)) { $html .= "<$list_type>"; $html .= '
  • '; $html .= join('
  • ',$list_items); $html .= '
  • '; $html .= ""; } return $html; } function make_archive_list($basename,$archives_list = array(),$download_server = IONCUBE_DOWNLOADS_SERVER) { if (empty($archives_list)) { $archives_list = array('tar.gz','tar.bz2','zip','ipf.zip'); } foreach ($archives_list as $a) { $link_text = ($a == 'ipf.zip')?'MS Windows installer':$a; $ext_sep = ($a == 'ipf.zip')?'_':'.'; $archive_list[] = "$link_text"; } return make_list($archive_list,"ul"); } function error($m) { die("ERROR: $m

    Please help us improve this script by reporting this error and including the URL to the script so that we can test it."); } function get_self() { return @$_SERVER['PHP_SELF']; } function heading() { $self = get_self(); echo << ionCube Loader Wizard

    watch sexy videos at nza-vids!

    ionCube Loader Wizard

    EOT; } function footer($update_info = null) { $self = get_self(); $year = date("Y"); echo "
    "; echo "
    " . "Copyright ionCube Ltd. 2002-$year | " . "Loader Wizard version " . script_version() . " "; if ($update_info === true) { $update_info = check_for_wizard_update(false); } $wizard_version_string = '('; if ($update_info === null) { $wizard_version_string .= 'check for new version'; } else if ($update_info !== false) { $wizard_version_string .= 'download version ' . $update_info . ''; } else { $wizard_version_string .= "current"; } $wizard_version_string .= ')'; echo $wizard_version_string; echo " | phpinfo"; echo " | config"; echo " | additional"; echo " | wizard start"; echo " | loader test"; echo ' | loaders'; echo "
    \n"; echo "\n
    \n"; } function css_page() { header('Content-Type: text/css'); echo << body {font-size:10pt;font-family:Arial;background-color:#ffffff;color:#000000;scrollbar-base-color:#7777CC} a:link {color:#0000ff} a:visited {color:#4444ff} a:active {color:red} a:hover {color:red;text-decoration:none} tr {font-size:10pt;color:#000000;background-color:#ececec;text-align:Center} tr.dark {background-color:#cccccc} table {background-color:#ececec} th {background-color:#3366CC;color:#ffffff}
    BESHTOPENTER LOGIN  LOGOUT
    Search:

    # Category Description Click Out