Challenge accepted?! :)
The second link provides functionality that would get you to the point of loading and instantiating an observer class through the use of the auto_loaders type structure. Basically whatever "function" you wanted to be done would be the 'autoType' in the auto_loaders file. Effectively the method called within the InitSystem is 'processAutoLoader' . $var['autoType'] (yes there is some case play, but lets say you wanted to load a class file (such as an observer), then the 'autoType' would be 'class' to load the class, then 'classInstantiate' to initialize the class (calling its __construct method).)
To "simply" require a file would in fact need some "path" information as discussed above about "finding" where things are currently located so that the associated processAutoLoaderRequire method could pull in the correct file(s).
For loading a class would likely have the autoloader look something like:
Code:
<?php
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
$autoLoadConfig[200][] = [
'autoType' => 'class',
'classPath' => 'observers/',
'loadFile' => 'new_observer.php',
];
$autoLoadConfig[200][] = [
'autoType' => 'classInstantiate',
'className' => 'zcObserverNewObserverClass',
'objectName' => 'myObsVariable',
'classSession' => false,
'checkInstantiated' => false,
];
This seems as if it would load an observers class in the admin directory of the plugins section for "this" version of the plugin.
The last two variables of the classInstantiate section are not required, but at least provide a template for what might be expected in instantiating a class through the plugin controller...