简体   繁体   English

使用 php 显示服务器 ioncube 加载程序版本

[英]Show server ioncube loader version with php

I am using ioncube to encode my scripts.我正在使用 ioncube 对我的脚本进行编码。

But i don't know the loader version that is installed on sever.但我不知道服务器上安装的加载程序版本。

Is there any way or any code or any function to Show the exact version of IONCUBE loader version ?有什么方法或任何代码或任何函数来显示IONCUBE加载程序版本的确切版本吗?

It's an old question, but it's always good to know that the easiest way to find out the exact version of the ionCube Loader is to SSH to the server and type这是一个老问题,但知道找出 ionCube Loader 确切版本的最简单方法是通过 SSH 连接到服务器并输入

php -v

This will give you something like :这会给你类似的东西:

PHP 5.5.30 (cli) (...)
with the ionCube PHP Loader v4.7.5, Copyright (c) 2002-2014, by ionCube Ltd.(...)

If the Loader is installed, you can retrieve this programatically by calling ioncube_loader_version() or ioncube_loader_iversion() in the Loader API.如果安装了 Loader,您可以通过在 Loader API 中调用 ioncube_loader_version() 或 ioncube_loader_iversion() 以编程方式检索它。

phpinfo() as suggested will show the Loader version too if the Loader is installed at the time of the call.如果在调用时安装了 Loader,建议的 phpinfo() 也会显示 Loader 版本。

The User Guide PDF has more details of the Loader API.用户指南 PDF 包含有关加载程序 API 的更多详细信息。

You can simply use phpinfo() .您可以简单地使用phpinfo() If you want to check it's loaded or not, you can use extension_loaded() .如果要检查它是否已加载,可以使用extension_loaded()

<?php
phpinfo();

Here is my solution to get ionCube version from phpInfo:这是我从 phpInfo 获取 ionCube 版本的解决方案:

function GetIonCubeLoaderVersion()
{
    ob_start();
    phpinfo(INFO_GENERAL);
    $aux = str_replace('&nbsp;', ' ', ob_get_clean());
    if($aux !== false)
    {
        $pos = mb_stripos($aux, 'ionCube PHP Loader');
        if($pos !== false)
        {
            $aux = mb_substr($aux, $pos + 18);
            $aux = mb_substr($aux, mb_stripos($aux, ' v') + 2);

            $version = '';
            $c = 0;
            $char = mb_substr($aux, $c++, 1);
            while(mb_strpos('0123456789.', $char) !== false)
            {
                $version .= $char;
                $char = mb_substr($aux, $c++, 1);
            }

            return $version;
        }
    }

    return false;
}

Use the following function.使用以下功能。 phpinfo not work if listed in disable_functions如果在 disable_functions 中列出,则 phpinfo 不起作用

function GetIonCubeLoaderVersion() {
        if (function_exists('ioncube_loader_version')) {
            $version = ioncube_loader_version();
            $a = explode('.', $version);
            $count = count($a);
            if ($count == 3) {
                return $version;
            } elseif ($count == 2) {
                return $version . ".0";
            } elseif ($count == 1) {
                return $version . ".0.0";
            }
            $version = implode('.', array_slice($a, 0, 3));
            return $version;
        }
        return 'Not Found!';
}

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

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