function windows_install_dir()
{
    $sysinfo = get_sysinfo();
    if ($sysinfo['SS'] == 'IIS') {
        if (false === ($ext_dir = extension_dir_path())) {
            $parent_dir = ini_dir();
            $ext_dir = $parent_dir . '\\ext';
            if (!empty($parent_dir) && @file_exists($ext_dir)) {
                $loader_dir = $ext_dir;
            } else {
                $loader_dir = $_SERVER['windir'] . '\\' . WINDOWS_IIS_LOADER_DIR;
            }
        } else {
            $loader_dir = $ext_dir;
        }
    } else {
        $parent_dir = ini_dir();
        $loader_dir = $parent_dir . '\\' . 'ioncube';
    }
    return $loader_dir;
}
Example #2
0
function runtime_loader_location()
{
    $loader_path = false;
    $ext_path = extension_dir_path();
    if ($ext_path !== false) {
        $id = $ext_path;
        $here = dirname(__FILE__);
        if (isset($id[1]) && $id[1] == ':') {
            $id = str_replace('\\', '/', substr($id, 2));
            $here = str_replace('\\', '/', substr($here, 2));
        }
        if (!is_php_version_or_greater(5, 2, 5)) {
            $rd = str_repeat('/..', substr_count($id, '/')) . $here . '/';
            $i = strlen($rd);
            $loader_loc = DIRECTORY_SEPARATOR . LOADER_SUBDIR . DIRECTORY_SEPARATOR . get_loader_name();
            while ($i--) {
                if ($rd[$i] == '/') {
                    $loader_path = runtime_location_exists($ext_path, $rd, $i, $loader_loc);
                    if ($loader_path !== false) {
                        break;
                    }
                }
            }
        } else {
            $loader_loc = '';
        }
        if (!$loader_path && !empty($loader_loc) && @file_exists($loader_loc)) {
            $loader_path = basename($loader_loc);
        }
    }
    return $loader_path;
}
Example #3
0
function loader_install_dir($server_type)
{
    if (SERVER_SHARED_INI == $server_type) {
        $loader_dir = get_default_loader_dir();
    } else {
        if (is_ms_windows()) {
            $sysinfo = get_sysinfo();
            if ($sysinfo['SS'] == 'IIS') {
                if (false === ($ext_dir = extension_dir_path())) {
                    $loader_dir = $_SERVER['windir'] . '\\' . WINDOWS_IIS_LOADER_DIR;
                } else {
                    $loader_dir = $ext_dir;
                }
            } else {
                if (!empty($sysinfo['PHP_INI'])) {
                    $parent_dir = dirname($sysinfo['PHP_INI']);
                } else {
                    $parent_dir = $_SERVER["PHPRC"];
                }
                $loader_dir = $parent_dir . '\\' . 'ioncube';
            }
        } else {
            $loader_dir = UNIX_SYSTEM_LOADER_DIR;
        }
    }
    return $loader_dir;
}