Skip to content

Simplify path generation in config.core.php #15623

Open
@Ruslan-Aleev

Description

@Ruslan-Aleev

Feature request

Summary

After installing MODX, a config.core.php file is created in the folders: /, connectors/, core/ and manager/ with the paths of the server folders, for example in /:

<?php
/*
 * This file is managed by the installation process.  Any modifications to it may get overwritten.
 * Add customizations to the $config_options array in `core/config/config.inc.php`.
 *
 */
define('MODX_CORE_PATH', '/home/a/account/folder/public_html/core/');
define('MODX_CONFIG_KEY', 'config');

But why not use the __DIR__ and __FILE__ constants when generating these paths?

Then the config.core.php file in / would look like this:

<?php
/*
 * This file is managed by the installation process.  Any modifications to it may get overwritten.
 * Add customizations to the $config_options array in `core/config/config.inc.php`.
 *
 */
define('MODX_CORE_PATH', dirname(__FILE__) . '/core/');
define('MODX_CONFIG_KEY', 'config');

Why is it needed?

When you move a site to another server, there will be less editing and fewer possible bugs.

Metadata

Metadata

Assignees

Labels

area-coreproposalProposal about improvement aka RFC. Need to be discussed before start implementation.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions