6
6
655362014-10-20 14:02:09
PHP
65536, 2014-10-20 14:02:09

MODX, path hardcoding - why?

Why are absolute paths hardcoded in MODX-e during installation? Why couldn't the definition of the root be moved somewhere in a shared file and use $_SERVER['DOCUMENT_ROOT'] by default - a variable that is defined in 99.(9)% of cases? And who does not have it, or who still wants to hardcode it, could change it in one place, and not in 4 files 9 times.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sanes, 2014-10-20
@Sanes

What does hardcoded mean? It's not clear what the problem is..

M
Mikhail Osher, 2014-10-20
@miraage

For the developers of MODx were not smart enough to create an independent constant
define('ROOT_PATH', dirname(__FILE__));

U
ugodrus, 2014-10-22
@ugodrus

I don't see any problem at all. The only problem is when moving the site. You have to change the configs in the root, manager, connectors. But otherwise the hard way is the opposite good. I often have to make modules with the system API and it is easier to connect them with hard routes. Try to go back to EVO and see what kind of jamb there was with routes. Each module was referenced in its own way. But now it's fun to watch.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question