无法解码ionCube编码的Smarty(3.1.18)模板文件

时间:2014-08-21 12:54:33

标签: php smarty smarty3 ioncube

我已经使用ionCube(版本8.3)来加密.tpl,.php文件,包括智能库文件,我能够成功编码它们,并检查所有混淆选项并能够生成密钥文件。但是当我尝试打开我的index.php页面时,它会给我以下错误...

致命错误:未捕获的异常' LogicException'有消息'功能' smartyAutoload'找不到(功能' smartyAutoload'未找到或无效的功能名称)'在C:\ cc \ htdocs \ App_Encode \ Smarty \ libs \ Smarty.class.php:0堆栈跟踪:#0 C:\ cc \ htdocs \ App_Encode \ Smarty \ libs \ Smarty.class.php(0):混淆# 1 C:\ cc \ htdocs \ App_Encode \ index_standard_creation.php(0):在第0行的C:\ cc \ htdocs \ App_Encode \ Smarty \ libs \ Smarty.class.php中抛出的unknown()#2 {main}

由ionCube提供的补丁适用于Smarty 2. *  ..因为我使用 Smarty 3.1.18 版本和 PHP Ver。 5.5 ...

我无法理解问题所在,因为我是PHP编程的新手。 我在\ libs \ plugins \ smarty_internal_resource_file.php中的getContent()函数中尝试过以下补丁。但是它没用:(

public function getContent(Smarty_Template_Source $source)
{
   if ($source->timestamp) {
        if (function_exists('ioncube_read_file')) {
            return ioncube_read_file($source->filepath);
        } else {
            return file_get_contents($source->filepath);
        }
    }
    if ($source instanceof Smarty_Config_Source) {
        throw new SmartyException("Unable to read config {$source->type} '{$source->name}'");
    }
    throw new SmartyException("Unable to read template {$source->type} '{$source->name}'");
}

请帮帮我!!

1 个答案:

答案 0 :(得分:1)

你已经使用了来自http://www.smarty.net/forums/viewtopic.php?t=20562

的Smarty 3的优秀补丁

您还必须对Smarty或至少补丁文件进行编码,因为ioncube_read_file()只能在编码文件中使用(在这种情况下,在非编码文件中使用解密例程是没有意义的)。如果存在错误,ioncube_read_file()将返回错误代码作为整数而不是文件内容作为字符串,因此您可以扩展补丁以测试它并在某处记录错误代码。错误代码也作为ionCube Loader定义的常量存在,代码和常量记录在用户指南PDF中。