I'm currently developing an extension that can be used by page types and other extensions.
I'm running code in the onAfterInit() method of my extension, and I want to allow other extensions to run code before that.
However Extension isn't extending Object, so I cannot create my own extension points.
I can't ensure that my code is run after all other onAfterInit() code (what if another module also wants to run last), so do I have any options?
AFAIK, no you don't have any control over making sure your extension is 'last' in the Extension API.
In an application you could add the extension before your extension and then in theory your extension would run last. By using the config system you could specify that your config comes after any other config so might run last?
FYI After further experimentation, the most robust solution I've found was to simply use the config.yml API.
Initially, I was using After: "*" however my onAfterInit method was then loaded before everything else (testing through Debug statements). Therefore the result I settled on is to define Before: "mysite" because it seems onAfterInit is not applied in the correct logical order.