Skip to content

Composer implementation for dependencies and autoload#1912

Merged
jdevalk merged 17 commits into
Yoast:trunkfrom
Rarst:composer
Jan 29, 2015
Merged

Composer implementation for dependencies and autoload#1912
jdevalk merged 17 commits into
Yoast:trunkfrom
Rarst:composer

Conversation

@Rarst

@Rarst Rarst commented Jan 16, 2015

Copy link
Copy Markdown
Contributor

Functional and ready to merge.

  • deprecates Git submodules
  • implements autoload via Composer w/ PHP 5.2 compatibility

See #1890

Intermediary instructions to install for testing (this will be down to single create-project in the end):

git clone https://github.com/Rarst/wordpress-seo --branch composer
cd wordpress-seo
composer install --no-dev

@Rarst Rarst mentioned this pull request Jan 16, 2015
10 tasks
@Rarst

Rarst commented Jan 16, 2015

Copy link
Copy Markdown
Contributor Author

Interesting aspect about testing — can you build using PHP 5.3+ on Travis, but test using PHP 5.2?

@Rarst

Rarst commented Jan 19, 2015

Copy link
Copy Markdown
Contributor Author

Tests working, except coding style, see https://travis-ci.org/Yoast/wordpress-seo/jobs/47506113

Outstanding issues with that:

  1. PHP 5.2 linter cannot parse some of vendor (not used, but still present).
  2. Similarly WPCS detects errors with some of vendor.

Exclude vendor from checks altogether? Everything except vendor/yoast ?

@jdevalk

jdevalk commented Jan 19, 2015

Copy link
Copy Markdown
Contributor

I'd exclude vendor indeed.

@Rarst

Rarst commented Jan 20, 2015

Copy link
Copy Markdown
Contributor Author

Oookay, Composer all working and tests all green, including coding style and PHP 5.2

Next — writing up docs (where is good place for it?), getting team up to speed, and updating build process (which is what?).

It would be helpful if team started to try out intermediary install instructions above and enumerated what doesn't work smoothly and/or needs explaining.

@jrfnl

jrfnl commented Jan 20, 2015

Copy link
Copy Markdown
Contributor

The wiki seems like a logical place for instructions and such and possibly for the documentation as well ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this conditional is removed, the WPSEO_Options constructor will need to be adjusted as it now checks for whether the class exists before creating/loading that option which would no longer be a valid test once you remove this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've moved the check to the _MS class' constructor (after checking in w/ @jdevalk if that makes sense in architecture). It will be instanced, but won't run logic unless in multisite context.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Rarst I'd have to look in detail, but I suspect that will still make some things go wrong as in the WPSEO_Options class, the available instances are used for certain actions and that logic relies on the _ms option not being instantiated (when not on multisite).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm ok, @Rarst can you look at that specific bit? :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I stared at it and need a little more specific pointer towards part that might be going wrong. :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have the time at the moment to look at it and argue it in detail. The short of it is that your are changing the expected behaviour of the object without cause.

I suggest you either change the conditional in the WPSEO_Options class as I suggested before or add the conditional to the get_instance() method of the _ms class instead of the constructor. That way the behaviour doesn't change (instance will be null rather than a nearly empty object).
The constructor of the WPSEO_Options class needs to change either way as the whole class_exists() doesn't make sense anymore with all option classes always being available.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added skip for MS only instances in Options constructor in 0decfde

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Rarst Thanks. Oh... the class_exists() can go now and the else should also apply to the code you've now added.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I misunderstood else (thought it's cleaning up instances, not pruning input list). Adjusted in https://github.com/Rarst/wordpress-seo/commit/797d6039205b062cfd30efeb7b422be7b45333a2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries, looks all good now ;-) Thanks for bearing with me on this.

@jdevalk

jdevalk commented Jan 21, 2015

Copy link
Copy Markdown
Contributor

I agree with @jrfnl on the wiki being the spot. @omarreiss could you see whether you can get it to work already based on the input by @Rarst in this pull?

@Rarst

Rarst commented Jan 22, 2015

Copy link
Copy Markdown
Contributor Author

I think this is now in good shape to merge into trunk and start testing out in that context (so that going through my fork step isn't required).

Although I would hold on that if anyone has unresolved implementation and/or workflow questions?

Comment thread composer.json Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be Team Yoast :)

@jdevalk

jdevalk commented Jan 22, 2015

Copy link
Copy Markdown
Contributor

One last minor comment and then I'm all for it. @omarreiss any feedback?

@omarreiss

Copy link
Copy Markdown
Contributor

Nothing much, maybe drop a line in the Readme about local (development) setup? What steps do I need to take to get the plugin running from source?

@Rarst

Rarst commented Jan 22, 2015

Copy link
Copy Markdown
Contributor Author

I'll update readme in a bit (need to eat :) ). The draft of instructions for common procedures (I could think of right away) is already up in in the wiki, ask if anything.

@omarreiss

Copy link
Copy Markdown
Contributor

@Rarst Nice Wiki article! I had somehow missed that. I guess it would be more than enough to drop a reference to that article in the readme.

@Rarst

Rarst commented Jan 26, 2015

Copy link
Copy Markdown
Contributor Author

Readme updated, workflow possibilities ironed out some in the issue.

@Rarst

Rarst commented Jan 29, 2015

Copy link
Copy Markdown
Contributor Author

Anything lingering that needs to happen for merge? :)

@omarreiss

Copy link
Copy Markdown
Contributor

👍 from me. @jrfnl @jdevalk ?

@jrfnl

jrfnl commented Jan 29, 2015

Copy link
Copy Markdown
Contributor

I don't think I'll have time to play with this (test it) before I'll be travelling again, so go for it.
I'll try and get it working when I'm back in March and if I run into trouble with it (which I no doubt will, through no fault but my own), I'll contact @Rarst.

I just won't be able to run any more tests or send in PRs between when this is merged and when I'll have the time to get things working in two months time.

jdevalk pushed a commit that referenced this pull request Jan 29, 2015
Composer implementation for dependencies and autoload
@jdevalk jdevalk merged commit 3686346 into Yoast:trunk Jan 29, 2015
@jdevalk

jdevalk commented Jan 29, 2015

Copy link
Copy Markdown
Contributor

Merged :D

@Rarst Rarst deleted the composer branch January 29, 2015 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants