+ add for chinesize encrypt.

This commit is contained in:
wangyidong
2012-08-14 07:32:40 +00:00
parent dfda27d5ca
commit 85e283602a
2 changed files with 52 additions and 1 deletions

36
bin/callback.php Normal file
View File

@@ -0,0 +1,36 @@
<?php
function ioncube_event_handler($err_code, $params)
{
$expired = "
<html>
<head>
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
<title>error</title>
</head>
<body>
<h1 style='color:red;text-align:center'>您的软件已经到期</h1>
<p>网站错误:您的软件已经到期,功能无法继续使用。如果想要继续使用,请续费。</p>
</body>
</html>
";
$server = "
<html>
<head>
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
<title>error</title>
</head>
<body>
<h1 style='color:red;text-align:center'>软件运行服务器受限制</h1>
<p>网站错误软件运行服务器IP受限制请在正确的IP服务器下运行。</p>
</body>
</html>
";
if($err_code == ION_LICENSE_EXPIRED)
{
echo $expired;
}
elseif($err_code == ION_LICENSE_SERVER_INVALID)
{
echo $server;
}
}

View File

@@ -151,6 +151,18 @@ if($defaultValue)
file_put_contents($defaultDir . basename($filePath) . '.php', $valueFile);
}
$file = "/tmp/$dirName";
$noLoader = "
'<html>
<head>
<meta http-equiv=\'content-type\' content=\'text/html; charset=utf-8\' />
<title>error</title>
</head>
<body>
<h1 style=\'color:red;text-align:center\'>未安装 ioncube loader</h1>
<p>网站错误:文件'.__file__.'需要安装ioncube php loader 解析,该网站需要安装'.basename(\\\$__ln).'。如果你是网站所有者,请使用<a href=\'http://www.ioncube.com/lw/\'>ioncube loader安装向导</a>。</p>
</body>
</html>'
";
/* encrypt file*/
echo "Encrypting extension\n";
@@ -165,8 +177,11 @@ $order->type = $type;
$passphrase = PASSWORD;
createLicense($order, $dirName, '/tmp/encrypt/');
$withLicense = "--with-license config/license/" . basename($file) . ".txt --passphrase $passphrase";
$callbackFile = dirname(__FILE__) . "/callback.php";
echo `cp $callbackFile /tmp/encrypt/$dirName/config/license/`;
$callback = "--callback-file config/license/callback.php";
exec("/usr/local/ioncube/ioncube_encoder5 --copy config.php --copy phpexcel/ --copy tmp/ --copy hook/ --copy framework/ --copy config/ --copy view/ --copy lang/ $withLicense $file --update-target --into /tmp/encrypt/", $outError);
exec("/usr/local/ioncube/ioncube_encoder5 --copy config.php --copy phpexcel/ --copy tmp/ --copy hook/ --copy framework/ --copy config/ --copy view/ --copy lang/ $withLicense $callback --message-if-no-loader \"$noLoader\" $file --update-target --into /tmp/encrypt/", $outError);
foreach($outError as $error)
{
$errorFile = substr($error, 0 , strpos($error, ':'));