i was able to keep the complete plugin (including the observer) within the encapsulated directory structure. in addition, i was then able to use the observer set up from within that plugin in a script outside of that observer. so my observer was set up here:
zc_plugins/myBloodyPlugin/1.0.0/admin/includes/classes/observers/myBloodyPlugin_observer.php
zc_plugins/myBloodyPlugin/1.0.0/admin/includes/auto_loaders/config.myBloodyPlugin.php
and my code within the auto_loaders was something like:
PHP Code:
$autoLoadConfig[210][] = [
'autoType' => 'class',
'classPath' => 'includes/classes/observers/',
'loadFile' => 'myBloodyPlugin_observer.php',
];
$autoLoadConfig[210][] = [
'autoType' => 'classInstantiate',
'className' => 'myBloodyPluginObserver',
'objectName' => 'myBloodyPluginObserver'
];
it was definitely tricky at the time and @mc definitely provided great help in getting that done.
if you use the debugging turned on (DEBUG_AUTOLOAD), you can see if it is in fact getting loaded.
i do not think the auto loaders discussion relates to the issue you may be experiencing. the auto loaders would eliminate the need for the auto_loader file providing you have the file named correctly. that (according to zcwilt) is slated for v158. but using an observer from within the encapsulated directory is definitely supported in v157, but I thought it felt a little tricky to get working....
hope that helps.
Bookmarks