Skip to content
Snippets Groups Projects
Commit bc6ac8ed authored by efalcy's avatar efalcy
Browse files

add autoload

parent 6b6c869b
No related merge requests found
<?php
spl_autoload_register(
function ($class)
{
$prefix = 'phpseclib\\';
$base_dir = __DIR__ . '/phpseclib/';
$len = strlen($prefix);
if (strncmp($prefix, $class, $len) !== 0) {
return;
}
$relative_class = substr($class, $len);
$file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';
if (file_exists($file)) {
require $file;
}
});
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment