Success

User tests: Successful: Unsuccessful:

avatar elkuku
elkuku
15 Nov 2013

This is about refactoring the controller classes and using the core DIC instead of our own bread. However nothing of the "DIC magic" using reflection classes and such has been applied yet.

I think the current execute method is far too complex as it not only instantiates the view and the model as also echoing the result of the views render method.
Child classes have pretty less to override.
So I moved the instantiation of the model and view to an initialize method that sets up the model and view based on the $defaultView property or the controller name.

So child classes can override this method and inject stuff to model and view classes. Note that the parent class must be called first.

class Foo extends AbstractTrackerController
{
    public function initialize()
    {
        parent::initialize();

        $this->model->setFoo('bar');

        // ...

        return $this;
    }
}

I also finished the renaming of the controller classes, which I started in 4e554f5, and apparently nothings blew ;)

avatar elkuku elkuku - open - 15 Nov 2013
avatar elkuku elkuku - open - 15 Nov 2013
avatar b2z
b2z - comment - 13 Dec 2013

Can we merge it? It includes the vital functional changes in the controllers, so more it stays umerged more harder is to code new features :(

avatar elkuku
elkuku - comment - 13 Dec 2013

I admit that the scope is quite broad... but it wasn't really doable without touching some low level parts :(
@b2z: If you want to pick up on this, make a PR that contains only the controller changes, that'd be perfectly fine - just copy and paste :wink:

avatar b2z
b2z - comment - 13 Dec 2013

But what currently is perventing us from the merge? From the code perspective I do not see any issues and if they exists then we will fix them :) It would be more harder to do it later...

avatar elkuku
elkuku - comment - 15 Dec 2013

@b2z can you merge it ? ;)
Maybe @mbabker is expecting you to merge this (and perhaps also the language related PRs) ....

avatar b2z
b2z - comment - 16 Dec 2013

May be :) But I think I am not so experienced PHP dev to decide about the merges ;)
@mbabker is busy with the CMS 3.2.1 release, so I do not know - can we decide both on such merges without his approve :confused:

avatar mbabker
mbabker - comment - 16 Dec 2013

I'm not the one making final decisions around here on everything, just enabling folks to develop on a highly visible project and updating a remote server :wink:

avatar dbhurley
dbhurley - comment - 16 Dec 2013

I think the hesitancy is purely from the number of files touched. :)

It looks good here though and I can merge this and the related language unless anyone has a concern.

avatar b2z
b2z - comment - 16 Dec 2013

I am :+1:

avatar dbhurley dbhurley - reference | - 16 Dec 13
avatar dbhurley dbhurley - merge - 16 Dec 2013
avatar dbhurley dbhurley - close - 16 Dec 2013
avatar dbhurley
dbhurley - comment - 16 Dec 2013

@elkuku Any related language PRs?

avatar b2z
b2z - comment - 16 Dec 2013

@dbhurley I think we are talking here about #214 and #222.

avatar elkuku elkuku - head_ref_deleted - 16 Dec 2013
avatar elkuku
elkuku - comment - 16 Dec 2013

:sparkles:

The PR related to this one would be #217 (should be easier to review..)

@b2z what if you take care of the language PRs ? The JavaScript stuff really needs a lot of testing as it's quite alpha :wink:

avatar b2z
b2z - comment - 16 Dec 2013

@elkuku ok, just update them and I will test the JavaScript.

Add a Comment

Login with GitHub to post a comment