Zen Follower
- Join Date:
- Apr 2004
- Posts:
- 79
- Plugin Contributions:
- 0
Value for $autoLoadConfig offset ???
How do I choose a value for the $autoLoadConfig offset (i.e., Breakpoint")? The WIKI has as an example:
$autoLoadConfig[90][] = array('autoType'=>'class',
'loadFile'=>'observers/class.freeProduct.php');
$autoLoadConfig[90][] = array('autoType'=>'classInstantiate',
'className'=>'freeProduct',
'objectName'=>'freeProduct');
But how did the WIKI writer know that 90 would be a good choice?
Note: 90 has been chosen as the offset since the observer needs to attach to the $SESSION['cart'] class (see the freeProduct example below), which is instantiated at offset 80.
I guess my problem is that I'm trying to get control from procedural code (rather than a class) via NOTIFY_LOGIN_SUCCESS and NOTIFY_LOGIN_SUCCESS_VIA_CREATE_ACCOUNT. I've looked at includes/auto_loaders/config.core.php and just can't figure which breakpoint is appropriate. I also don't understand why the WIKI uses 90 when 90 is already used in config.core.php for "currencies".
Should I just use "999" as my offset and hope for the best that I don't collide with another add-on?
Thanks,
Tony Benedetti