Quote from: sottwell at Aug 24, 2007, 11:40 PM
Hmmm... the /manager/index.php just requires the includes/init/index.php file. This file immediately starts in with $modx stuff... where does the $modx get defined???
Hmm, I guess it should only be on everything after phase2.php is required; I must have gotten a little overanxious when forcing the configurable paths in front of these files. But, I also must have subconsciously wanted to refactor that whole thing: to reduce the number of separate files being included, and so that the modX class (and a specific configuration) gets loaded earlier to determine the paths to the default manager context (mgr).
Each context you deploy in 0.9.7, be it the web or mgr contexts, or a custom context of your own making, will be deployed in a configurable directory. The index.php (we’ll call it a gateway or front-controller) in each context should simply know how to get to and instantiate the MODx core (which will work from a configurable location), and everything else from there should be controlled by the instance of the MODx core, initialized to that context. My vision is to have a tool that uses simple templates (a la core/config/config.inc.tpl) to setup these modX gateways with the proper paths to the core classes, and somehow registers this context gateway with the core. These gateways could be used as-is to provide entry-points to specific contexts, or extended to be a complex manager interface (as it is here), included in other scripts for access to the API’s and data in a specific context, supplemented by companion .htaccess generators and other utilities, etc.
I’ll get this part of the manager initialization cleaned up and in-line with what I just said as soon as I can. Just thinking of how best to register contexts in the default manager, deal with context-specific configurations, multi-sites, sub-sites, etc.