繁体   English   中英

将ioncube loader捆绑到应用程序中

[英]Bundling ioncube loader to the application

我想知道是否可以创建一个处理程序来处理ioncube加载程序。 通常的方法是,编码文件尝试检测ioncube加载程序,如果找不到该文件,则会引发错误:

if(!extension_loaded('ionCube Loader')){$__oc=strtolower(substr(php_uname(),0,3));$__ln='ioncube_loader_'.$__oc.'_'.substr(phpversion(),0,3).(($__oc=='win')?'.dll':'.so');if(function_exists('dl')){@dl($__ln);}if(function_exists('_il_exec')){return _il_exec();}$__ln='/ioncube/'.$__ln;$__oid=$__id=realpath(ini_get('extension_dir'));$__here=dirname(__FILE__);if(strlen($__id)>1&&$__id[1]==':'){$__id=str_replace('\\','/',substr($__id,2));$__here=str_replace('\\','/',substr($__here,2));}$__rd=str_repeat('/..',substr_count($__id,'/')).$__here.'/';$__i=strlen($__rd);while($__i--){if($__rd[$__i]=='/'){$__lp=substr($__rd,0,$__i).$__ln;if(file_exists($__oid.$__lp)){$__ln=$__lp;break;}}}if(function_exists('dl')){@dl($__ln);}}else{die('The file '.__FILE__." is corrupted.\n");}if(function_exists('_il_exec')){return _il_exec();}echo('Site error: the file <b>'.__FILE__.'</b> requires the ionCube PHP Loader '.basename($__ln).' to be installed by the website operator. If you are the website operator please use the <a href="http://www.ioncube.com/lw/">ionCube Loader Wizard</a> to assist with installation.');exit(199);

根据宿主环境,例如通过php.ini文件将其声明为ZendExtension来插入ioncube加载程序。 是否可以将ZendExtenion的加载直接移植到php文件,并将加载程序捆绑到php文件中,而不是安装ioncube加载程序?

并不是的。 PHP曾经有一个名为dl()的函数,可以即时安装PHP模块,这就是ionCube编码文件开头的代码及其“运行时加载”机制所使用的代码。 加载程序可以与应用程序捆绑在一起,并且该应用程序通常无需更改任何安装即可运行,这很棒。 PHP 5.2.5中的一些更改对该机制产生了一些影响,但是dl()从PHP 5.3开始确实变得不那么有用了,因为从某些SAPI中删除了dl()。 该机制仍可用于某些服务器,但是现在通常需要安装php.ini。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM