Quote from: BobRay at Jan 25, 2016, 10:57 PMI haven't had much luck finding the code that can't find the core directory in setup.
Looks like it goes like this:
- setup/index.php loads setup/includes/config.core.php (https://github.com/modxcms/revolution/blob/2.x/setup/index.php#L98)
- config.core.php defines MODX_CORE_PATH unless it's been previously defined (i.e. earlier in setup/index.php) (https://github.com/modxcms/revolution/blob/2.x/setup/includes/config.core.php#L2)
- setup/index.php instantiates modInstall() and runs modInstall's findCore() method (https://github.com/modxcms/revolution/blob/2.x/setup/includes/modinstall.class.php#L510-L528)
- modInstall->findCore(), if it can't find the core based on the MODX_CORE_PATH constant value, loads templates/findcore.php, which asks the user
What's interesting is that setup/index.php
does have an accommodation for differing core location and config_key,
if it's run from the command line. Check out:
https://github.com/modxcms/revolution/blob/2.x/setup/index.php#L42-L47.
Here's the commit that made that happen:
https://github.com/modxcms/revolution/commit/79506e227229446f17f8bdd32e4dc18170bb76c5
Still no apparent attempt to grab the values for core directory and config_key from the config file on existing installs; at least not that I can see.
This is a really quick and dirty idea, but one way that could change that is setup/index.php line 98 could be replaced by a test for the existence of the
MODX_INSTALL_PATH . 'config.core.php'
file, and if present (pre-existing install), use it. If not load the default one from setup/includes/config.core.php the way it's done now.
At least one negative side effect to that would be to blow-up CLI runs of setup that did change MODX_CORE_PATH and/or MODX_CONFIG_KEY via request parameters.
Other unexpected side-effects unknown and would certainly need careful consideration.
For what it's worth.
[ed. note: clareoconsulting last edited this post 9 years ago.]