31 lines
715 B
PHP
31 lines
715 B
PHP
<?php
|
|
|
|
/**
|
|
* luxtools plugin autoloader.
|
|
*
|
|
* DokuWiki will often load plugin entrypoints (syntax.php, action.php, ...)
|
|
* directly. We keep those files small and place reusable code in src/.
|
|
*
|
|
* This file registers a minimal autoloader for the plugin namespace.
|
|
*/
|
|
|
|
spl_autoload_register(static function ($class) {
|
|
$prefix = 'dokuwiki\\plugin\\luxtools\\';
|
|
$prefixLen = strlen($prefix);
|
|
|
|
if (strncmp($class, $prefix, $prefixLen) !== 0) {
|
|
return;
|
|
}
|
|
|
|
$relative = substr($class, $prefixLen);
|
|
if ($relative === '') {
|
|
return;
|
|
}
|
|
|
|
$file = __DIR__ . '/src/' . str_replace('\\', '/', $relative) . '.php';
|
|
|
|
if (is_file($file)) {
|
|
require_once $file;
|
|
}
|
|
});
|