CoreFiles by mySites.guru
autoload-php7.php31 lines, 890 bytes, from wordpress-7.0.zip
Raw History Compare with 6.9.11
md5
14d11dafb7b116d2e16efdf4ad349ce7
sha1
574ce6b8b079b8873147535ef683bf8403e96b09
sha256
1578b1c6f97fe3bd1417e6b493c4f55b1666659b1e6dafa3b22d7730f90f1144
<?php
/*
 This file should only ever be loaded on PHP 7+
 */
if (PHP_VERSION_ID < 70000) {
    return;
}

spl_autoload_register(function ($class) {
    $namespace = 'ParagonIE_Sodium_';
    // Does the class use the namespace prefix?
    $len = strlen($namespace);
    if (strncmp($namespace, $class, $len) !== 0) {
        // no, move to the next registered autoloader
        return false;
    }

    // Get the relative class name
    $relative_class = substr($class, $len);

    // Replace the namespace prefix with the base directory, replace namespace
    // separators with directory separators in the relative class name, append
    // with .php
    $file = dirname(__FILE__) . '/src/' . str_replace('_', '/', $relative_class) . '.php';
    // if the file exists, require it
    if (file_exists($file)) {
        require_once $file;
        return true;
    }
    return false;
});

The same content is in 411 releases, WordPress 5.6-beta1 to 7.2-RC1. See them all, or every version of this file.