2010-08-13 14 views
8

estoy usando el siguiente código:mejor método para comprobar si IonCube cargador está instalado

<?php 
if(extension_loaded("IonCube Loader")) {  
    // Yes 
} 
else { 
    // No 
} 
?> 

sólo estoy preocupado de que esto no funcionará a través de cada servidor con IonCube habilitado. Parece bastante estándar, pero nunca he tenido que verificarlo antes. ¿Es esta la mejor manera de verificar o hay un método mejor que debería usar?

+0

Lo siento, pero ¿hay algún punto para esto? Si intenta ejecutar un script de IonCube en un servidor donde no está cargado, eso no funcionará y obtendrá un mensaje de error. – NullUserException

+8

Sí, hay un punto. Estoy ejecutando un script para descargar un script codificado de un servidor y ejecutarlo. Si IonCube no está habilitado, toda la aplicación fallará. La comprobación de IonCube me guarda una solicitud del servidor y evita el mensaje de error al que se refiere. – jdp

+0

Para mí también es más fácil verificar que digg en los registros porque una pantalla en blanco ... – erm3nda

Respuesta

8

Si la extensión no está instalada, esto le devolverá a falso, por lo que yo sé que es la forma correcta de comprobar si una extensión está disponible para su uso.

Otra opción es usar get_loaded_extensions(). Esto le devuelve una matriz con nombres de extensión disponibles. Podrías verificar si este arrays contiene tu extensión deseada.

+1

$ gefunden = false; foreach (get_loaded_extensions() como el número $ => $ extension_name) { if ((strpos (strtolower ($ extension_name), "ioncube")) === false) {// hacer nada } demás { $ gefunden = true; } } –

1

otro método es

<?php 
phpinfo() 
?> 

y buscar bajo el encabezado del módulo adicional, que debe ser capaz de ver

ionCube cargador

0

En realidad yo uso de SSH para la mayoría de las cosas, incluyendo el archivo dupdo. Cuando necesito verificar si el cargador ionCube es más fácil para mí, es solo php -m.

Los módulos Zend se enumeran en la parte inferior, debido al orden alfabético.

Mi salida (últimas 2 líneas): [Zend Modules] the ionCube PHP Loader.

Para otras opciones utilicé php -m | grep -v grep | grep MODULENAME. Si está cargado aparece en la lista, de lo contrario, se vaciará. (excepto si olvidó el tubo grep -v grep).

+0

Como ionCube Loader es ante todo una extensión de motor PHP, también puede usar php -v y grep allí. – Nick

1

Aquí el código PHP cifrada con la última v9.0 codificador (PHP 5.6/7.0), si ionCube cargador está funcionando debería ver el texto de "trabajo", si ves cheque en blanco para los registros de la página PHP:

<?php //0046b 
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); 

?> 
HR+cPx6tTyKRWKphuWtYvXZumJL99w6eqPcw8RguzcdITTB7WMCLNusEXyi1ot1iTgoc8y+lkgal 
weKJYPcyEXz2sBTUIeIHQN7vfrMG/Ys05+GSnrFlOfwMdT2vSUzgGklS7q+TPV6jMAtLBIdSi/iY 
vfUB+Kooide9x8xN1lkZ3GKNJHS0RXQXHEtXPJ6BGuBw34zozLdp1vDRasmOCERhww6Ic2D8gpFD 
gUiOhgsx6jvgIfXU6nWArCcZDyYjA+owXjguuiL+VJFurIhudMJprcXoQK5mv7JzzWN1gPskCSld 
IjjPQuDbgsG8swBRL/l22DW0/CMxuYzl1jfhxc6bbrShp5JHB/9A6GXyusbLWdQjsOIIZOdIvaXq 
O4t8BAwatZ4aenKJ3cXFt+Ns9ElRZN8l6M/iBG83OcbzsDjxKsPtdcYzumohoHjKML0dAWw9cS87 
S+IZaxiWYURWvJbGMNH+plFCa6YKAI9ghmH3zT9HwWAOMcBtffeMr8CTTbrdSido8V+az8ZkMS6U 
jQ5C9rCR8+oIxaKNxmv53eyIpxOx+XTr4Thh4grecMeLpOOm1U72ryXi0odClC0Ab3uGpu/lzNrj 
oEg7XrSVOn7hS+VJ9khwj3s1zg1OVyrS2TTrvTIsw6h1xbKCitG9rRwPp/fv31voi7MC3K4= 

Aquí código PHP codificado con el codificador legado 8,3 (PHP 5.6 y por debajo):

<?php //0046b 
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); 

?> 
HR+cPp7q/tHOKq74dpvDQdk0enKwrkMD5yeF5eIiq+jd6h+ygyi99Yw9v+skX6plOCkD0S6vxDVT 
g0nNVh2ujlRTSIiRAeEKpFhEG5BUvsr+EDaYN5HxECz/I9hYPAwp8hOqYfRctH5qT/1rYIX59wku 
VRQDHVPzAMbv4kcSC/d/76RrKED24mpGOTteHWb4gyV5wkMY3lauJ2Kt525x+66BeXwGFubP+Ty4 
bTvQZAlcRrNw7vkhaGIx6DWxyYWED5EFPWI3/GZ0xzTbpL83DUVUtS/ediGlJTj5NyBlLtEcuRLv 
XE5a6kiJU6ZLCcSmSDdBluUKyuUqqIwddbhBpeNik8bzS3aT6kOxhwlOIQZeunaIaLdBDlUGcQ6i 
1Op7pe9lurj06xerCWDRwcQjFjpj3ZVCR1z9NuCRkV+YCYWS 

Aquí código PHP codificado con el codificador Obsoleted 7,0 (PHP 5.6 y por debajo):

<?php //0046b 
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); 

?> 
HR+cPztBoaaSBCzkpN9VQlx61diBTKY3K9Mo6QkiHctnYMVjt+wt5LKPQiXrdL2L4kPfUYzmMESC 
lcAxEsG3poSelwD+kdd08ZYEwxLBpp7ygESUJ3bafOEpLpdkuPTvrz8X69Zu7qlvz818LBJQe/Tz 
mxcC8cJvxWBWfyVldqFIfwAdP7FElroV7giVwaoFWplm+3Ut5FutMAWRd7f95Gb9ghPgLSMS7crq 
4Qx1E3bK1BTXgDrKZ0RfRbd2gSLZlA97dGwTbM8ccs9bbie3LGVEtZlGR/J9Bz142go08cr/Taym 
xfs4+ITF7iqEk8gWdywHV1tYKJvc26w4bpIW51IcXdcd0QDIdhx4PfTVmMxyVVmqPuVv8L23N6EI 
sTAuCNc5o8LjRzW2Yp4ctMJVPKkjWmg4HKs95xZABDbJ 
Cuestiones relacionadas