Package file run precedents
Permalink
I have a package and I want one of its controllers methods to run before 'config/base.php' runs. I would also be satisfied if I could get one of that packages files to load before 'config/base.php'. Is this at all possible?
OOPS! I didn't think of you needing this for a package install. That is exactly why I am searching the concrete5 forums. This will work if you are only needing it for your website and have access to the site's files. If this is the case, you don't need to package your work, just create your project as blocks and such. It won't work for a package because the installer controller has to be able to modify any web site's loading configuration. So far the only way to hook into the dispatcher's loading is illegal with the marketplace criteria since it involves the install controller modifying config files that are called by the dispatcher. I will return here to let you know what I have found if I am successful in my project.
I may have an answer for you but if you are creating a package that will install from Add Functionality, what is your concern about controllers loading before config/base.php? Your package is not adding anything to this file, is it?
You might try copying the /concrete/config/base_pre.php file to the root/config directory if you don't already have one there. This will over-ride concrete5's file. Put any code you need in this file. Do not disturb anything already in this file or, better yet, you can and probably the preferable way, use an 'include_once("your_code.php")' in the root/config/base_pre.php file. (Never modify a concrete5 file, always over-ride.) Be sure to test it thoroughly to make sure that all this is running properly because if it isn't, it could break the dispatcher load.
I came to this discussion of yours because I am looking for a way to hook into the site wide page load hoping for an incite to my issue.