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

Draft
wants to merge 3 commits into
base: 3.x
from

Conversation

Projects
None yet
4 participants
@sergant210
Copy link
Contributor

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)

No.

@Ruslan-Aleev

This comment has been minimized.

Copy link
Contributor

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 <Alroniks@users.noreply.github.com>
Update _build/resolvers/resolve.core.php
Co-Authored-By: Ivan Klimchuk <Alroniks@users.noreply.github.com>
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.