Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance the main application class #14574

wants to merge 3 commits into
base: 3.x


None yet
4 participants
Copy link

commented Apr 27, 2019

For discussion...

What does it do?

Adds ability for enhancing the main application class (modX). And move the composer autoloader from modX class to the index.php.

Why is it needed?

This PR allows to extend the modX class correctly following the "Open/Close" principle. All you need is to specify the desired class in the config.core.php file.
One more advantage - no need to pass the modx object to classes like that

function __construct(modX &$modx) {
        $this->modx= & $modx;

Now you can get the application object at any part of yuor application

function __construct() {
        $this->modx = modX::getInstance();

The same must be done for manager/index.php and connectors/index.php.

Related issue(s)/PR(s)



This comment has been minimized.

Copy link

commented May 1, 2019

@Alroniks @Jako @JoshuaLuckers @Mark-H @opengeek It would be great to see your comments :) any ideas on this PR?

@JoshuaLuckers JoshuaLuckers requested a review from opengeek May 4, 2019

sergant210 and others added some commits May 12, 2019

Update _build/templates/config.core.php.txt
Co-Authored-By: Ivan Klimchuk <>
Update _build/resolvers/resolve.core.php
Co-Authored-By: Ivan Klimchuk <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.