2

我正在尝试使用 ZendGuard 5.5 for PHP5.3 锁定一些 PHP,并且在 PHP 5.2 下运行良好,没有任何问题。我可以在未加密的情况下很好地运行代码,但是当我添加加密时,它会引发以下错误:

致命错误:在第 0 行的 ../app/code/local/MyModule/TestModule/Model/Mysql4/Setup.php 中找不到类“Zend_Log”

如果我开始用未加密的版本替换有问题的文件,则错误会移动到模块中的其他加密文件。

以下是放置在每个 PHP 文件顶部以启用许可证支持的代码。此代码实际上适用于最近编程的另一个新模块。

if(zend_loader_file_encoded()) {

    if(!zend_loader_enabled() || !zend_get_id()) {

        exit('<strong>Error:</strong> The Zend Optimizer loader is not enabled! <br /><br />To enable it, please modify the following in your php.ini:  zend_optimizer.enable_loader = on.');
                                                }

            else if(!zend_loader_file_licensed()){
                $licensePath = Mage::getModuleDir('etc', 'MyModule_TestModule'). DS . 'license' . DS . 'license.zl';
                    if(!file_exists($licensePath)) {
                        exit("<strong>Error:</strong> No license file was found. Your license file should be located in: $licensePath. <br /><br />If you do not have a license, you need to obtain one from the Dev Team by contacting: <a href=\"mailto:devteam@site.com\">devteam@site.com</a>.");
                                               } 

if(!zend_loader_install_license($licensePath)) {
exit('<strong>Error:</strong> An error occurred while loading your license file. Please contact support at <a href="mailto:devteam@site.com">devteam@site.com</a>.');
                       }
                    }
                }

我已经搜索了低和高,无法为我的生活弄清楚这一点。任何帮助将不胜感激。

4

1 回答 1

0

在使用 ZendGuard 编码一些代码后,我遇到了类似的“找不到类”错误。

禁用变量、函数和类名的混淆重新编码为我解决了这个问题。

ZendGuard 编码器似乎无法处理某些类型的不寻常但合法的 PHP 语法。

于 2014-03-26T03:13:35.753 回答