feature(composer): Fully support installing Elgg as a composer dependency #8431

Merged
merged 1 commit into from Jul 1, 2015

Conversation

Projects
None yet
6 participants
@ewinslow
Member

ewinslow commented Jun 8, 2015

TODOs:

  • Auto register magic files/dirs: start.php, views, and languages (not classes, though, we want people to use composer).
  • add scripts that auto-copy from elgg to root dir if necessary
  • distinguish between elgg root and installation root.
  • Add BC break docs RE elgg_get_root_path, $CONFIG->path, etc.
  • Add composer install instructions
  • Double-check install-Elgg-at-root still works? Need this in order to avoid complication with current CI.
  • Document the new site-local-modifications feature in the developer guides somewhere.
  • 4 LGTMs (@hypeJunction, @jeabakker, @mrclay?, @Srokap?)
  • No blockers

ewinslow added a commit to ewinslow/Elgg that referenced this pull request Jun 14, 2015

feature(composer): Fully support installing Elgg as a composer depend…
…ency

This change makes it *necessary* to install Elgg as a composer dependency.
It is not possible to run it any other way at this point because so many
relative paths assume that Elgg is installed at /vendor/elgg/elgg/.

Fixes #8431

@ewinslow ewinslow closed this Jun 14, 2015

@ewinslow ewinslow reopened this Jun 14, 2015

@ewinslow ewinslow modified the milestone: Elgg 2.0.x Jun 15, 2015

@ewinslow

This comment has been minimized.

Show comment
Hide comment
@ewinslow

ewinslow Jun 17, 2015

Member

@Srokap I think I'm going to need you to jump in and help drive this one. I'm concerned it's going to slip from 2.0 since it's such a drastic change in people's mental models of how Elgg works, but that would make me ever so sad since this is one of those things that really hampers productivity.

Oh I want to make local modifications... Do I just modify these files I've been given? Or no, I have to write a plugin because Don't Modify Core. I don't want to write a plugin. I just want to make my website. Well, ok, if I have to... Wait manifest.xml? start.php? Good grief I just want to change the homepage. Oh, I have to give it a name? What should that be I have no idea... naming things is hard. OK I've got a name... Wait now how to I check this all in, do I fork Elgg and commit my plugin to that, or put my plugin in its own repo and modify Elgg's composer.json file? GAWWWWWWSHSHSHSH WHY IS THIS SO HARD I JUST WANTED TO OVERRIDE THE HOMEPAGE.

Member

ewinslow commented Jun 17, 2015

@Srokap I think I'm going to need you to jump in and help drive this one. I'm concerned it's going to slip from 2.0 since it's such a drastic change in people's mental models of how Elgg works, but that would make me ever so sad since this is one of those things that really hampers productivity.

Oh I want to make local modifications... Do I just modify these files I've been given? Or no, I have to write a plugin because Don't Modify Core. I don't want to write a plugin. I just want to make my website. Well, ok, if I have to... Wait manifest.xml? start.php? Good grief I just want to change the homepage. Oh, I have to give it a name? What should that be I have no idea... naming things is hard. OK I've got a name... Wait now how to I check this all in, do I fork Elgg and commit my plugin to that, or put my plugin in its own repo and modify Elgg's composer.json file? GAWWWWWWSHSHSHSH WHY IS THIS SO HARD I JUST WANTED TO OVERRIDE THE HOMEPAGE.

@ewinslow

This comment has been minimized.

Show comment
Hide comment
@ewinslow

ewinslow Jun 17, 2015

Member

I will happily give you write access to my fork so you can push straight to this branch to update the PR

Member

ewinslow commented Jun 17, 2015

I will happily give you write access to my fork so you can push straight to this branch to update the PR

ewinslow added a commit to ewinslow/Elgg that referenced this pull request Jun 22, 2015

feature(composer): Fully support installing Elgg as a composer depend…
…ency

This change makes it *necessary* to install Elgg as a composer dependency.
It is not possible to run it any other way at this point because so many
relative paths assume that Elgg is installed at /vendor/elgg/elgg/.

Fixes #8431

ewinslow added a commit to ewinslow/Elgg that referenced this pull request Jun 23, 2015

ewinslow added a commit to ewinslow/Elgg that referenced this pull request Jun 23, 2015

feature(composer): Fully support installing Elgg as a composer depend…
…ency


Fixes #8431

Can register views, translations, and start.php from the root dir now

I left out "classes" intentionally to encourage composer autoloader usage.

ewinslow added a commit to ewinslow/Elgg that referenced this pull request Jun 23, 2015

feature(composer): Fully support installing Elgg as a composer depend…
…ency

Can register views, translations, and start.php from the root dir now

I left out "classes" intentionally to encourage composer autoloader usage.

Fixes #8431
@ewinslow

This comment has been minimized.

Show comment
Hide comment
@ewinslow

ewinslow Jun 25, 2015

Member

@Elgg/owners @Elgg/contributors This addresses my greatest pain point with Elgg right now. If anyone is uncomfortable pulling this in for 2.0 within the week (after I get the failures ironed out), pretty please speak up soon so I can address them.

This is the last major change I'd like to get in for 2.0 (assuming the js/ and css/ prefix pr goes in). It requires breaking change to elgg_get_root_path() in that we won't be able to guarantee whether elgg is installed at root or as composer vendor, so elgg root and app root are going to be two separate concepts rather than the same thing. My thought is that we should point it always at the app root for the sake of plugins trying to point at the /mod/ dir and then deprecate it for removal in 3.0 in favor of other APIs since plugins shouldn't be assuming anything about the file structure of the app they're installed in, or any other plugin, or core.

I think being able to install and update elgg with composer while making site local modifications in the root version-controlled directory would be a n unquestionably massive bump up in terms of developer experience and productivity.

We'll have to figure out our pitch to people who aren't comfortable with command line, since that is a large contingent of our user base and we don't want to alienate them, but I don't think we need to have that totally ironed out before we start doing pre-releases either.

To be clear, this isn't about requiring composer-fu to be able to work with elgg at all, just about making composer a possible option for those comfortable with command line scripting.

Member

ewinslow commented Jun 25, 2015

@Elgg/owners @Elgg/contributors This addresses my greatest pain point with Elgg right now. If anyone is uncomfortable pulling this in for 2.0 within the week (after I get the failures ironed out), pretty please speak up soon so I can address them.

This is the last major change I'd like to get in for 2.0 (assuming the js/ and css/ prefix pr goes in). It requires breaking change to elgg_get_root_path() in that we won't be able to guarantee whether elgg is installed at root or as composer vendor, so elgg root and app root are going to be two separate concepts rather than the same thing. My thought is that we should point it always at the app root for the sake of plugins trying to point at the /mod/ dir and then deprecate it for removal in 3.0 in favor of other APIs since plugins shouldn't be assuming anything about the file structure of the app they're installed in, or any other plugin, or core.

I think being able to install and update elgg with composer while making site local modifications in the root version-controlled directory would be a n unquestionably massive bump up in terms of developer experience and productivity.

We'll have to figure out our pitch to people who aren't comfortable with command line, since that is a large contingent of our user base and we don't want to alienate them, but I don't think we need to have that totally ironed out before we start doing pre-releases either.

To be clear, this isn't about requiring composer-fu to be able to work with elgg at all, just about making composer a possible option for those comfortable with command line scripting.

@hypeJunction

This comment has been minimized.

Show comment
Hide comment
@hypeJunction

hypeJunction Jun 25, 2015

Contributor

This looks ok to me

Contributor

hypeJunction commented Jun 25, 2015

This looks ok to me

@@ -64,6 +64,11 @@ public function __construct() {
if (!isset($CONFIG)) {
$CONFIG = new stdClass;
}
+
+ global $_ELGG;

This comment has been minimized.

@mrclay

mrclay Jun 25, 2015

Member

Why is this showing up here? Do you need to rebase?

@mrclay

mrclay Jun 25, 2015

Member

Why is this showing up here? Do you need to rebase?

This comment has been minimized.

@ewinslow

ewinslow Jun 25, 2015

Member

I think I rebased at one point and added it. If it shouldn't be here I'll just remove it...

@ewinslow

ewinslow Jun 25, 2015

Member

I think I rebased at one point and added it. If it shouldn't be here I'll just remove it...

This comment has been minimized.

@ewinslow

ewinslow Jun 25, 2015

Member

Global state GRRR

@ewinslow

ewinslow Jun 25, 2015

Member

Global state GRRR

engine/settings.cloud9.php
+}
+
+// Must set timezone explicitly for cloud9!
+date_default_timezone_set('America/Los_Angeles');

This comment has been minimized.

@juho-jaakkola

juho-jaakkola Jun 26, 2015

Member

Why LA by default?

@juho-jaakkola

juho-jaakkola Jun 26, 2015

Member

Why LA by default?

This comment has been minimized.

@ewinslow

ewinslow Jun 26, 2015

Member

Does it matter? Cloud9 is a dev server. This file probably shouldn't even be here.

@ewinslow

ewinslow Jun 26, 2015

Member

Does it matter? Cloud9 is a dev server. This file probably shouldn't even be here.

@juho-jaakkola

This comment has been minimized.

Show comment
Hide comment
@juho-jaakkola

juho-jaakkola Jun 26, 2015

Member

This change makes it necessary to install Elgg as a composer dependency.

...

this isn't about requiring composer-fu to be able to work with elgg at all, just about making composer a possible option

Wait, what?

Member

juho-jaakkola commented Jun 26, 2015

This change makes it necessary to install Elgg as a composer dependency.

...

this isn't about requiring composer-fu to be able to work with elgg at all, just about making composer a possible option

Wait, what?

@ewinslow

This comment has been minimized.

Show comment
Hide comment
@ewinslow

ewinslow Jun 26, 2015

Member

@juho-jaakkola Non-CL-savvy users do not need to learn Composer as a result of this change.

Member

ewinslow commented Jun 26, 2015

@juho-jaakkola Non-CL-savvy users do not need to learn Composer as a result of this change.

ewinslow added a commit to ewinslow/Elgg that referenced this pull request Jun 26, 2015

feature(composer): Fully support installing Elgg as a composer depend…
…ency

Can register views, translations, and start.php from the root dir now

I left out "classes" intentionally to encourage composer autoloader usage.

Fixes #8431

ewinslow added a commit to ewinslow/Elgg that referenced this pull request Jun 26, 2015

feature(composer): Fully support installing Elgg as a composer depend…
…ency

Can register views, translations, and start.php from the root dir now

I left out "classes" intentionally to encourage composer autoloader usage.

Fixes #8431
@ewinslow

This comment has been minimized.

Show comment
Hide comment
@ewinslow

ewinslow Jun 26, 2015

Member

Squashed everything down so the lint build will start passing and I can focus on the errors that are actually errors.

Member

ewinslow commented Jun 26, 2015

Squashed everything down so the lint build will start passing and I can focus on the errors that are actually errors.

ewinslow added a commit to ewinslow/Elgg that referenced this pull request Jun 26, 2015

feature(composer): Fully support installing Elgg as a composer depend…
…ency

Can register views, translations, and start.php from the root dir now

I left out "classes" intentionally to encourage composer autoloader usage.

Fixes #8431
@juho-jaakkola

This comment has been minimized.

Show comment
Hide comment
@juho-jaakkola

juho-jaakkola Jun 26, 2015

Member

So we will still create the regular zip packages when making a release? But if you're not installing from a zip, you'll need to use composer?

Member

juho-jaakkola commented Jun 26, 2015

So we will still create the regular zip packages when making a release? But if you're not installing from a zip, you'll need to use composer?

@ewinslow

This comment has been minimized.

Show comment
Hide comment
@ewinslow

ewinslow Jun 26, 2015

Member

Yes, which is same as today, I believe.

Member

ewinslow commented Jun 26, 2015

Yes, which is same as today, I believe.

ewinslow added a commit to ewinslow/Elgg that referenced this pull request Jun 27, 2015

feature(composer): Fully support installing Elgg as a composer depend…
…ency

Can register views, translations, and start.php from the root dir now

I left out "classes" intentionally to encourage composer autoloader usage.

Fixes #8431

ewinslow added a commit to ewinslow/Elgg that referenced this pull request Jun 27, 2015

feature(composer): Fully support installing Elgg as a composer depend…
…ency

Can register views, translations, and start.php from the root dir now

I left out "classes" intentionally to encourage composer autoloader usage.

Fixes #8431

ewinslow added a commit to ewinslow/Elgg that referenced this pull request Jun 29, 2015

feature(composer): Fully support installing Elgg as a composer depend…
…ency

Can register views, translations, and start.php from the root dir now

I left out "classes" intentionally to encourage composer autoloader usage.

Fixes #8431
@ewinslow

This comment has been minimized.

Show comment
Hide comment
@ewinslow

ewinslow Jun 29, 2015

Member

@Elgg/owners This is ready to go now. Latest change includes lots of docs improvements. Being able to put customizations in the root folder makes everything way simpler since you don't have to explain plugins right off the bat...

Member

ewinslow commented Jun 29, 2015

@Elgg/owners This is ready to go now. Latest change includes lots of docs improvements. Being able to put customizations in the root folder makes everything way simpler since you don't have to explain plugins right off the bat...

@jeabakker

This comment has been minimized.

Show comment
Hide comment
@jeabakker

jeabakker Jun 29, 2015

Member

I see in you doc changes that you also replaced the usage of elgg_get_plugins_path() but didn't report this as a breaking changed function, maybe document this (or point me to where you did this)

for the rest i think this looks ok

Member

jeabakker commented Jun 29, 2015

I see in you doc changes that you also replaced the usage of elgg_get_plugins_path() but didn't report this as a breaking changed function, maybe document this (or point me to where you did this)

for the rest i think this looks ok

@ewinslow

This comment has been minimized.

Show comment
Hide comment
@ewinslow

ewinslow Jun 29, 2015

Member

What is the change you're referring to? That function shouldn't have
changed. I may have simply removed it from some examples because its use
was gratuitous.

On Mon, Jun 29, 2015, 6:05 AM Jerôme Bakker notifications@github.com
wrote:

I see in you doc changes that you also replaced the usage of
elgg_get_plugins_path() but didn't report this as a breaking changed
function, maybe document this (or point me to where you did this)

for the rest i think this looks ok


Reply to this email directly or view it on GitHub
#8431 (comment).

Member

ewinslow commented Jun 29, 2015

What is the change you're referring to? That function shouldn't have
changed. I may have simply removed it from some examples because its use
was gratuitous.

On Mon, Jun 29, 2015, 6:05 AM Jerôme Bakker notifications@github.com
wrote:

I see in you doc changes that you also replaced the usage of
elgg_get_plugins_path() but didn't report this as a breaking changed
function, maybe document this (or point me to where you did this)

for the rest i think this looks ok


Reply to this email directly or view it on GitHub
#8431 (comment).

@jeabakker

This comment has been minimized.

Show comment
Hide comment
@jeabakker

jeabakker Jun 29, 2015

Member

you say elgg_get_root_path() is a breaking change, so my question is doesn't this also apply to elgg_get_plugins_path()?

Example of bad behaviour:
my plugin (blog_tools) uses elgg_get_plugins_path() . 'blog/some-file' won't this break in the new way if i install blog_tools and Elgg as composer modules.

Member

jeabakker commented Jun 29, 2015

you say elgg_get_root_path() is a breaking change, so my question is doesn't this also apply to elgg_get_plugins_path()?

Example of bad behaviour:
my plugin (blog_tools) uses elgg_get_plugins_path() . 'blog/some-file' won't this break in the new way if i install blog_tools and Elgg as composer modules.

@ewinslow

This comment has been minimized.

Show comment
Hide comment
@ewinslow

ewinslow Jun 29, 2015

Member

No, since composer will put elgg-plugin packages in /mod/.

Member

ewinslow commented Jun 29, 2015

No, since composer will put elgg-plugin packages in /mod/.

@ewinslow

This comment has been minimized.

Show comment
Hide comment
@ewinslow

ewinslow Jun 29, 2015

Member

Though I'd like to know more about the use case there. It really shouldn't be necessary to access the files of another plugin directly. Turns private refactors into breaking changes...

Member

ewinslow commented Jun 29, 2015

Though I'd like to know more about the use case there. It really shouldn't be necessary to access the files of another plugin directly. Turns private refactors into breaking changes...

@jeabakker

This comment has been minimized.

Show comment
Hide comment
@jeabakker

jeabakker Jun 29, 2015

Member

yes, but my plugin is in /mod/blog_tools but 'core' blog is in /vendors/elgg/elgg/mod/blog
what is the result of elgg_get_plugins_path()

  1. /mod
  2. /vendor/elgg/elgg/mod

in both cases you can't reliably use elgg_get_plugins_path() (same as elgg_get_root_path())

Member

jeabakker commented Jun 29, 2015

yes, but my plugin is in /mod/blog_tools but 'core' blog is in /vendors/elgg/elgg/mod/blog
what is the result of elgg_get_plugins_path()

  1. /mod
  2. /vendor/elgg/elgg/mod

in both cases you can't reliably use elgg_get_plugins_path() (same as elgg_get_root_path())

@jeabakker

This comment has been minimized.

Show comment
Hide comment
@jeabakker

jeabakker Jun 29, 2015

Member

Though I'd like to know more about the use case there. It really shouldn't be necessary to access the files of another plugin directly.

Like i said, this was a bad example of something people shouldn't.

Maybe a better use case
I make a page_handler which is a class callback, in the page_handler i tell it to include a file in my plugins /pages folder. In order to avoid using dirname(dirname(dirname(....))) i use elgg_get_plugins_path() . /my_plugin/pages/somefile.php

folder structure
/classes/coldtrick/my_plugin/pagehandler.php
/pages/include_file.php
/start.php
/manifest.xml

this is installed by composer so in /mod/my_plugin, If i call elgg_get_plugins_path() which path do i get?

Member

jeabakker commented Jun 29, 2015

Though I'd like to know more about the use case there. It really shouldn't be necessary to access the files of another plugin directly.

Like i said, this was a bad example of something people shouldn't.

Maybe a better use case
I make a page_handler which is a class callback, in the page_handler i tell it to include a file in my plugins /pages folder. In order to avoid using dirname(dirname(dirname(....))) i use elgg_get_plugins_path() . /my_plugin/pages/somefile.php

folder structure
/classes/coldtrick/my_plugin/pagehandler.php
/pages/include_file.php
/start.php
/manifest.xml

this is installed by composer so in /mod/my_plugin, If i call elgg_get_plugins_path() which path do i get?

@ewinslow

This comment has been minimized.

Show comment
Hide comment
@ewinslow

ewinslow Jun 29, 2015

Member

That will still work, though we're now recommending you just go through the views system to render pages like this. See elgg_view_resource. Hopefully that makes your life easier anyways!

Member

ewinslow commented Jun 29, 2015

That will still work, though we're now recommending you just go through the views system to render pages like this. See elgg_view_resource. Hopefully that makes your life easier anyways!

@jeabakker

This comment has been minimized.

Show comment
Hide comment
@jeabakker

jeabakker Jun 29, 2015

Member

as far as i can see pluginspath points to $installpath/mod so the same problem as elgg_get_root_path()

see: https://github.com/Elgg/Elgg/blob/master/engine/lib/configuration.php#L319

Member

jeabakker commented Jun 29, 2015

as far as i can see pluginspath points to $installpath/mod so the same problem as elgg_get_root_path()

see: https://github.com/Elgg/Elgg/blob/master/engine/lib/configuration.php#L319

@ewinslow

This comment has been minimized.

Show comment
Hide comment
@ewinslow

ewinslow Jun 29, 2015

Member

It is the same as it's always been. There is no ambiguity. Plugins are all
installed to /mod/plugin/, even the bundled plugins in
/vendor/elgg/elgg/mod/plugin/ are copied to root mod (actually right now
they're pulled down with composer from their individual repos, but it
doesn't really matter).

If you test and find this isn't the case get back to me and we can fix it
for sure, but I tried and it wasn't causing me any issues.

On Mon, Jun 29, 2015, 7:52 AM Jerôme Bakker notifications@github.com
wrote:

as far as i can see pluginspath points to $installpath/mod so the same
problem as elgg_get_root_path()

see:
https://github.com/Elgg/Elgg/blob/master/engine/lib/configuration.php#L319


Reply to this email directly or view it on GitHub
#8431 (comment).

Member

ewinslow commented Jun 29, 2015

It is the same as it's always been. There is no ambiguity. Plugins are all
installed to /mod/plugin/, even the bundled plugins in
/vendor/elgg/elgg/mod/plugin/ are copied to root mod (actually right now
they're pulled down with composer from their individual repos, but it
doesn't really matter).

If you test and find this isn't the case get back to me and we can fix it
for sure, but I tried and it wasn't causing me any issues.

On Mon, Jun 29, 2015, 7:52 AM Jerôme Bakker notifications@github.com
wrote:

as far as i can see pluginspath points to $installpath/mod so the same
problem as elgg_get_root_path()

see:
https://github.com/Elgg/Elgg/blob/master/engine/lib/configuration.php#L319


Reply to this email directly or view it on GitHub
#8431 (comment).

@jeabakker

This comment has been minimized.

Show comment
Hide comment
@jeabakker

jeabakker Jun 30, 2015

Member

ok then LGTM

Member

jeabakker commented Jun 30, 2015

ok then LGTM

@mrclay

This comment has been minimized.

Show comment
Hide comment
@mrclay

mrclay Jun 30, 2015

Member

Needs rebase

Member

mrclay commented Jun 30, 2015

Needs rebase

ewinslow added a commit to ewinslow/Elgg that referenced this pull request Jun 30, 2015

feature(composer): Fully support installing Elgg as a composer depend…
…ency

Can register views, translations, and start.php from the root dir now

I left out "classes" intentionally to encourage composer autoloader usage.

Fixes #8431
@ewinslow

This comment has been minimized.

Show comment
Hide comment
@ewinslow

ewinslow Jun 30, 2015

Member

@mrclay Rebased. PTAL

Member

ewinslow commented Jun 30, 2015

@mrclay Rebased. PTAL

@ewinslow

This comment has been minimized.

Show comment
Hide comment
@ewinslow

ewinslow Jun 30, 2015

Member

I'd like to pull this in tonight so that we have the rest of the week to iron out release/packaging issues so we can ship 2.0.0-alpha.1 on July 5.

Member

ewinslow commented Jun 30, 2015

I'd like to pull this in tonight so that we have the rest of the week to iron out release/packaging issues so we can ship 2.0.0-alpha.1 on July 5.

@iionly

This comment has been minimized.

Show comment
Hide comment
@iionly

iionly Jun 30, 2015

Contributor

Why is installing Elgg via composer the recommended way? Sorry. But I see absolutely no sense in that. It might be okay to suggest it as an alternative for experiences users but I really think it is too complicated for everyday users.

And what do you think most people from where most people will get Elgg from? They will download it from the community site. And if they read then in the install instructions about composer without any detailed info about this is about in the first place there will just be a lot of very confused people.

If you ask me, the installation of Elgg via composer makes no sense for everyday users. It will be just too much / too complicated for most people. If the installation via composer would be embedded within a easy to use GUI then it might be a different thing. But right now I think the composer approach is something for developers / experienced users only and I think it would really better to give instruction of how to install Elgg in the "old way" first and mention the composer approach as possible alternative only. If it turns out in future that people have no problem installing Elgg via composer - and even prefer it this way - then it's still possible to change to install instructions. But I don't think the time for that is now.

Contributor

iionly commented Jun 30, 2015

Why is installing Elgg via composer the recommended way? Sorry. But I see absolutely no sense in that. It might be okay to suggest it as an alternative for experiences users but I really think it is too complicated for everyday users.

And what do you think most people from where most people will get Elgg from? They will download it from the community site. And if they read then in the install instructions about composer without any detailed info about this is about in the first place there will just be a lot of very confused people.

If you ask me, the installation of Elgg via composer makes no sense for everyday users. It will be just too much / too complicated for most people. If the installation via composer would be embedded within a easy to use GUI then it might be a different thing. But right now I think the composer approach is something for developers / experienced users only and I think it would really better to give instruction of how to install Elgg in the "old way" first and mention the composer approach as possible alternative only. If it turns out in future that people have no problem installing Elgg via composer - and even prefer it this way - then it's still possible to change to install instructions. But I don't think the time for that is now.

docs/intro/install.rst
- composer create-project Elgg/Elgg:~2.0 .
+ composer create-project elgg/starter-project:dev-master .
+
+If you're not comfortable with Composer, you can install from a pre-packaged zip:

This comment has been minimized.

@mrclay

mrclay Jun 30, 2015

Member

@iionly Did you see this section?

@mrclay

mrclay Jun 30, 2015

Member

@iionly Did you see this section?

This comment has been minimized.

@iionly

iionly Jun 30, 2015

Contributor

Of course, I read it. That's why I said that recommending the composer install and listing the "old way" as alternative only is in my opinion very likely not good with non-developers / inexperienced users in mind.

The commands listed for installing via composer alone will result in an inexperienced user being complete lost (let alone it will not work if composer is not installed). The advantages of composer might be great for developing and the instructions seem to have been written from the perspective of a developer addressing another developer. But I just don't see it working for non-developers.

@iionly

iionly Jun 30, 2015

Contributor

Of course, I read it. That's why I said that recommending the composer install and listing the "old way" as alternative only is in my opinion very likely not good with non-developers / inexperienced users in mind.

The commands listed for installing via composer alone will result in an inexperienced user being complete lost (let alone it will not work if composer is not installed). The advantages of composer might be great for developing and the instructions seem to have been written from the perspective of a developer addressing another developer. But I just don't see it working for non-developers.

This comment has been minimized.

@ewinslow

ewinslow Jun 30, 2015

Member

To answer the question directly: it makes updates way easier. Want to upgrade all your plugins? One command. Want to upgrade just a single plugin? One command. This is important in order to get security updates out to folks or just to get everyone comfortable in the latest and greatest.

And if you want to use composer but don't want the latest and greatest, you use more restrictive version numbers to indicate that. Everyone's happy!

I could add a clarification that it is recommended for those comfortable with command line, as opposed to just "recommended" which might be implied to mean "for everyone."

@ewinslow

ewinslow Jun 30, 2015

Member

To answer the question directly: it makes updates way easier. Want to upgrade all your plugins? One command. Want to upgrade just a single plugin? One command. This is important in order to get security updates out to folks or just to get everyone comfortable in the latest and greatest.

And if you want to use composer but don't want the latest and greatest, you use more restrictive version numbers to indicate that. Everyone's happy!

I could add a clarification that it is recommended for those comfortable with command line, as opposed to just "recommended" which might be implied to mean "for everyone."

docs/intro/install.rst
+
+.. _latest version of Elgg: https://elgg.org/download.php
+
+Elgg also supports installing with Composer:

This comment has been minimized.

@mrclay

mrclay Jun 30, 2015

Member

@ewinslow forgot to delete this, right?

@mrclay

mrclay Jun 30, 2015

Member

@ewinslow forgot to delete this, right?

This comment has been minimized.

@ewinslow

ewinslow Jun 30, 2015

Member

Will need to delete, yes.

@ewinslow

ewinslow Jun 30, 2015

Member

Will need to delete, yes.

.. code:: shell
cd /path/to/wwwroot/
composer self-update
composer global require "fxp/composer-asset-plugin:~1.0"
- composer create-project Elgg/Elgg:~2.0 .
+ composer create-project elgg/starter-project:dev-master .

This comment has been minimized.

@mrclay

mrclay Jun 30, 2015

Member

Shouldn't we specify a particular version here or in starter-project?

@mrclay

mrclay Jun 30, 2015

Member

Shouldn't we specify a particular version here or in starter-project?

This comment has been minimized.

@ewinslow

ewinslow Jun 30, 2015

Member

That's a good question. Maybe starter-project should specify the version of elgg. Will we even want/need to put versions on starter project?

@ewinslow

ewinslow Jun 30, 2015

Member

That's a good question. Maybe starter-project should specify the version of elgg. Will we even want/need to put versions on starter project?

@mrclay

This comment has been minimized.

Show comment
Hide comment
@mrclay

mrclay Jun 30, 2015

Member

From what I understand a composer install would make upgrades a lot faster and less error-prone. Seems worth it.

Member

mrclay commented Jun 30, 2015

From what I understand a composer install would make upgrades a lot faster and less error-prone. Seems worth it.

@mrclay

This comment has been minimized.

Show comment
Hide comment
@mrclay

mrclay Jun 30, 2015

Member

Let's make a separate ticket for which install method should be promoted, and how it will be documented. Doesn't need to block this ticket.

Member

mrclay commented Jun 30, 2015

Let's make a separate ticket for which install method should be promoted, and how it will be documented. Doesn't need to block this ticket.

ewinslow added a commit to ewinslow/Elgg that referenced this pull request Jul 1, 2015

feature(composer): Fully support installing Elgg as a composer depend…
…ency

Can register views, translations, and start.php from the root dir now

I left out "classes" intentionally to encourage composer autoloader usage.

Fixes #8431
feature(composer): Fully support installing Elgg as a composer depend…
…ency

Can register views, translations, and start.php from the root dir now

I left out "classes" intentionally to encourage composer autoloader usage.

Fixes #8431
@ewinslow

This comment has been minimized.

Show comment
Hide comment
@ewinslow

ewinslow Jul 1, 2015

Member

Pulling this in now... will work on getting elgg/starter-project ready and attempt to update the release script to package it so we can ensure install-from-zip is still well supported.

Member

ewinslow commented Jul 1, 2015

Pulling this in now... will work on getting elgg/starter-project ready and attempt to update the release script to package it so we can ensure install-from-zip is still well supported.

@ewinslow

This comment has been minimized.

Show comment
Hide comment
@ewinslow

ewinslow Jul 1, 2015

Member

I.e. I've heard a few objections but they're more around the details of how we pitch composer support and docs stuff, not the fundamental idea of composer.

Member

ewinslow commented Jul 1, 2015

I.e. I've heard a few objections but they're more around the details of how we pitch composer support and docs stuff, not the fundamental idea of composer.

ewinslow added a commit that referenced this pull request Jul 1, 2015

Merge pull request #8431 from ewinslow/composer-dependency
feature(composer): Fully support installing Elgg as a composer dependency

@ewinslow ewinslow merged commit fced777 into Elgg:master Jul 1, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@ewinslow ewinslow deleted the ewinslow:composer-dependency branch Jul 1, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment