Seems like it would be a good idea in the docs to indicate that constants such as DIR_WS_INCLUDES should not be used in plugins when referring to directories such as the classes and/or other "defined" paths...
Reason? those particular constants are associated with the store and not with the plugins where plugins should be developed to be applicable to "any" store's configuration. Meaning, the path used should be relative to the plugin's directory structure and not the store's directory structure when referencing items within the plugin's folder...
I was otherwise going to suggest actually using DIR_WS_CLASSES (which I thought was going to be used by the plugin loader path until you made the change identified above and showing the processed path here).
Btw, in line with DrByte's previous statement about loading a class file, using the above 'class'/'classInstantiate' would allow you to declare a variable name that can be used within your other plugin areas. That variable is the 'objectName'. In this way you don't have to "chase" down the current path for the file being loaded, just load the class as part of your plugin and reference it from within the plugin...



Reply With Quote
