HEX
Server: LiteSpeed
System: Linux srv1.dhviews.com 5.14.0-570.23.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jun 24 11:27:16 EDT 2025 x86_64
User: bdedition (1723)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: //proc/thread-self/root/proc/self/root/usr/local/softaculous/lib/classes/phpseclib/autoloader.php
<?php
/**
 * Custom Autoloader for phpseclib3 and its dependencies.
 *
 * This script registers a function that automatically loads class files
 * when they are first used. It is configured for the specific directory
 * structure provided.
 */
spl_autoload_register(function ($class) {
    // The base directory for this autoloader file is .../backuply/lib/classes/
    // We use __DIR__ to build the correct path from this location.

    $prefixes = [
        // Namespace for phpseclib and its path relative to this file
        'phpseclib3\\' => __DIR__ . '/phpseclib/',

        // Namespace for the 'paragonie' dependency and its path
        // IMPORTANT: This is required for phpseclib3 to work.
        'ParagonIE\\ConstantTime\\' => __DIR__ . '/paragonie/constant_time_encoding/src/',
    ];

    // Loop through the namespace prefixes
    foreach ($prefixes as $prefix => $base_dir) {
        // Does the class use the namespace prefix?
        $len = strlen($prefix);
        if (strncmp($prefix, $class, $len) !== 0) {
            // No, move to the next registered autoloader
            continue;
        }

        // Get the relative class name (e.g., Net\SFTP)
        $relative_class = substr($class, $len);

        // Replace the namespace separator with a directory separator and add .php
        $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';

        // If the file exists, require it and we're done
        if (file_exists($file)) {
            include($file);
            return;
        }
    }
});