* @package AgileBill
* @version 1.4.93
*/
if(@$do == 'phpinfo' || @$_GET['do'] == 'phpinfo' || @$HTTP_GET_VARS['do'] == 'phpinfo'){
phpinfo();
exit;
}
error_reporting(0);
$disabled_functions = ini_get('disable_functions');
ob_start();
phpinfo();
$php_info .= ob_get_contents();
ob_end_clean();
###############################################################
### ENCODING ###
if (eregi('Zend Optimizer', $php_info))
$zend = true;
else
$zend = false;
if (function_exists("mmcache"))
$mmcache = true;
else
$mmcache = false;
if (extension_loaded('ionCube Loader'))
{
$ioncube = true;
}
else
{
$ion = new ioncube_test;
$ioncube_arr = $ion->test();
if($ioncube_arr[0] == true)
$ioncube = true;
else
$ioncube = false;
}
if($ioncube || $mmcache || $zend )
{
$encoding['font'] = "FFFFFF";
$encoding['back'] = "009900";
$encoding['text'] = "OK:";
if($ioncube)
$encoding['text'] .= " [Ioncube] ";
if ($mmcache)
$encoding['text'] .= " [MMCache] ";
if ($zend)
$encoding['text'] .= " [Zend] ";
} else {
$encoding['font'] = "FFFFFF";
$encoding['back'] = "990000";
$encoding['text'] = "Failed.";
}
###############################################################
# GD
if (extension_loaded('gd'))
{
$gd['font'] = "FFFFFF";
$gd['back'] = "009900";
$gd['text'] = "OK";
} else {
$gd['font'] = "FFFFFF";
$gd['back'] = "990000";
$gd['text'] = "Failed.";
}
###############################################################
# SSL
$sslx = false;
if ( function_exists('curl_init') && !eregi('curl_init', $disabled_functions) && $curl_version = curl_version())
{
if (eregi('openssl', @$curl_version['ssl_version'] ))
{
$sslx = true;
}
} else {
if ( phpversion() >= '4.3.0' && function_exists("fsockopen") &&
!eregi('fsockopen', $disabled_functions) && function_exists("openssl_public_decrypt"))
$sslx = true;
}
if ($sslx == true)
{
$ssl['font'] = "FFFFFF";
$ssl['back'] = "009900";
$ssl['text'] = "OK";
} else {
$ssl['font'] = "FFFFFF";
$ssl['back'] = "990000";
$ssl['text'] = "Failed!";
}
###############################################################
# PHP
if(phpversion() >= '4.3' )
{
$php['font'] = "FFFFFF";
$php['back'] = "009900";
$php['text'] = "OK";
} else {
$php['font'] = "FFFFFF";
$php['back'] = "990000";
$php['text'] = "Failed!";
}
###############################################################
# MYSQL
if(is_callable("mysql_connect") && is_callable("mysql_get_client_info") && mysql_get_client_info() >= 4)
{
$mysql['font'] = "FFFFFF";
$mysql['back'] = "009900";
$mysql['text'] = "OK";
} else {
$mysql['font'] = "FFFFFF";
$mysql['back'] = "990000";
$mysql['text'] = "Failed!";
}
###############################################################
# XML
if(is_callable("xml_parser_create"))
{
$xml['font'] = "FFFFFF";
$xml['back'] = "009900";
$xml['text'] = "OK";
} else {
$xml['font'] = "FFFFFF";
$xml['back'] = "990000";
$xml['text'] = "Failed!";
}
###############################################################
# IMAP
if(is_callable("imap_open"))
{
$imap['font'] = "FFFFFF";
$imap['back'] = "009900";
$imap['text'] = "OK";
} else {
$imap['font'] = "FFFFFF";
$imap['back'] = "990000";
$imap['text'] = "Failed!";
}
?>
AgileBill Compatibility Test
|
">
ENCODING |
">
|
|
">
MySQL |
">
|
|
">
PHP |
">
|
|
">
XML |
">
|
|
|
|
">
SSL
Connectivity |
">
|
|
">
GD |
">
|
|
|
| => |v\">)([^ <]*)(.* $thread_safe,
'DEBUG_BUILD' => $debug_build,
'PHP_INI' => $php_ini_path,
'CGI_CLI' => $cgi_cli);
}
function test()
{
$nl = ((php_sapi_name() == 'cli') ? "\n" : ' ');
$ok = true;
$already_installed = false;
$here = dirname(__FILE__);
$sys_info = $this->ic_system_info();
if ($sys_info['THREAD_SAFE'] && !$sys_info['CGI_CLI']) {
$msg = "Your PHP install appears to have threading support and run-time Loading
is only possible on threaded web servers if using the CGI, FastCGI or
CLI interface.$nl${nl}To run encoded files please install the Loader in the php.ini file.$nl";
$ok = false;
}
if ($sys_info['DEBUG_BUILD']) {
$msg = "Your PHP installation appears to be built with debugging support
enabled and this is incompatible with ionCube Loaders.$nl${nl}Debugging support in PHP produces slower execution, is
not recommended for production builds and was probably a mistake.${nl}${nl}You should rebuild PHP without the --enable-debug option and if
you obtained your PHP install from an RPM then the producer of the
RPM should be notified so that it can be corrected.$nl";
$ok = false;
}
if (ini_get('safe_mode')) {
$msg = "PHP safe mode is enabled and run time loading will not be possible.$nl";
$ok = false;
}
// If ok to try and find a Loader
if ($ok) {
// Old style naming should be long gone now
$test_old_name = false;
$_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');
$_ln_old="ioncube_loader.$_loader_sfix";
$_ln_old_loc="/ioncube/$_ln_old";
$_ln_new="ioncube_loader_${_os_key}_${_php_family}${_loader_sfix}";
$_ln_new_loc="/ioncube/$_ln_new";
#echo "${nl}Looking for Loader '$_ln_new'";
if ($test_old_name) {
#echo " or '$_ln_old'";
}
#echo $nl.$nl;
$_extdir = ini_get('extension_dir');
if ($_extdir == './') {
$_extdir = '.';
}
$_oid = $_id = realpath($_extdir);
$_here = dirname(__FILE__);
if ((@$_id[1]) == ':') {
$_id = str_replace('\\','/',substr($_id,2));
$_here = str_replace('\\','/',substr($_here,2));
}
$_rd=str_repeat('/..',substr_count($_id,'/')).$_here.'/';
if ($_oid !== false) {
#echo "Extensions Dir: $_extdir ($_id)$nl";
#echo "Relative Path: $_rd$nl";
} else {
#echo "Extensions Dir: $_extdir (NOT FOUND)$nl$nl";
#echo "The directory set for the extension_dir entry in the
# php.ini file may not exist, and run time loading will not be possible.
# The system administrator should create the $_extdir directory,
# or install the Loader in the php.ini file.$nl";
$ok = false;
}
if ($ok) {
$_ln = '';
$_i=strlen($_rd);
while($_i--) {
if($_rd[$_i]=='/') {
if ($test_old_name) {
// Try the old style Loader name
$_lp=substr($_rd,0,$_i).$_ln_old_loc;
$_fqlp=$_oid.$_lp;
if(@file_exists($_fqlp)) {
$msg = "Found Loader: $_fqlp$nl";
return Array (true, $msg);
$_ln=$_lp;
break;
}
}
// Try the new style Loader name
$_lp=substr($_rd,0,$_i).$_ln_new_loc;
$_fqlp=$_oid.$_lp;
if(@file_exists($_fqlp)) {
$msg = "Found Loader: $_fqlp$nl";
return Array (true, $msg);
$_ln=$_lp;
break;
}
}
}
//
// If Loader not found, try the fallback of in the extensions directory
//
if (!$_ln) {
if ($test_old_name) {
if (@file_exists($_id.$_ln_old_loc)) {
$_ln = $_ln_old_loc;
}
}
if (@file_exists($_id.$_ln_new_loc)) {
$_ln = $_ln_new_loc;
}
if ($_ln) {
$msg = "Found Loader $_ln in extensions directory.$nl";
return Array (true, $msg);
}
}
echo $nl;
if ($_ln) {
#echo "Trying to install Loader - this may produce an error...$nl$nl";
dl($_ln);
if(extension_loaded('ionCube Loader')) {
$msg = "The Loader was successfully installed and encoded files should be able to
automatically install the Loader when needed. No changes to your php.ini file
are required to use encoded files on this system.${nl}";
return Array (true, $msg);
} else {
$msg = "The Loader was not installed.$nl";
return Array (false, $msg);
}
} else {
$msg = "Run-time loading should be possible on your system but no suitable Loader
was found.$nl$nl . The $_os Loader for PHP $_php_family releases is required.$nl";
return Array (true, $msg);
}
}
}
return Array (false, $msg);
}
}
?> |