jbroadway / elefant

Elefant, the refreshingly simple PHP CMS and web framework.
http://www.elefantcms.com
MIT License
209 stars 39 forks source link

Composer as default app install? #184

Open jonphipps opened 11 years ago

jonphipps commented 11 years ago

It occurred to me that since (nearly) all of the apps are installable by composer at this point, if composer was part of the standard Elefant install, rather than instruct designers to link to a github repo to install an app or theme you could simply let them check off the apps they want from a list and run a succession of background exec()s that run "composer require elefant/$appname" to install new apps. http://stackoverflow.com/questions/45953/php-execute-a-background-process#45966

installing portions of Elefant by Composer on initial install could also apply to some of the libraries that are installed by default that are now available on composer, like analog, urlify, pimple, and simplepie. That would make keeping them up-to-date much easier.

This should also get around the github one/per hour limitation, since that doesn't seem to apply to composer.

The downside would be PaaS hosts that didn't allow shell access, but you'd be able to do a full upload of a local Composer-based install to those.

I'm afraid I'm at risk of becoming more of an idea hamster than a contributor.

jbroadway commented 11 years ago

Haha no worries, we still need ideas for 3.0 :P

I think for Elefant 2, we'll keep the lib/vendor folder as it is for now, but move more and more to Composer over time. Updating those manually isn't the most efficient, but I want to be careful adding extra install steps. I'm loving Composer and wish there was a way to tap into it for GUI-based installs too. It's definitely an app/theme/library management tool that should be well supported in Elefant (technically it is, just not prominently mentioned and could be made better use of too).

But I don't know yet if we should go all-Composer or maintain the other install/update methods too. I'd like to make app/theme discovery a part of the web installer (was just writing about that actually: https://github.com/jbroadway/elefant/issues/182 and https://github.com/jbroadway/elefant/issues/183) that would involve a layer above Composer at least. Those are still just rough ideas though, coming from working on the new Elefant website right now.

I think the GUI experience for app/theme discovery and install is important. A big reason people love Wordpress is the web-based install and update process. I think we can create an even better experience with Elefant :)

To make Composer easier, I wonder if Elefant could have you specify a composer.phar on install, or even bundle its own, so the CLI install/update commands could wrap around that? Hmm...

jonphipps commented 11 years ago

I think the way you have composer setup to run the app-installer is quite nice and very transparent. Given that it handles the install for you, once you have Composer installed and the base site running, don't you basically just need to have the server run a composer require script in the shell, since that both updates the site's composer.json and installs the app? Easy enough to trigger that from the admin GUI once the site is running, even as part of the site initial setup process.

Silverstripe has a mostly Composer-based install that looks pretty interesting and looks like it could be improved with a gui layer above composer after the initial install.

http://doc.silverstripe.org/framework/en/installation/composer

I was also concerned at the moment about the fact that I need RSS feeds site-wide, so I'm installing simplepie via composer, as well as analog and it'll require a bit of reconfiguring to accommodate.

Jon

On Wed, Apr 24, 2013 at 4:35 PM, Johnny Broadway notifications@github.comwrote:

Haha no worries, we still need ideas for 3.0 :P

I think for Elefant 2, we'll keep the lib/vendor folder as it is for now, but move more and more to Composer over time. Updating those manually isn't the most efficient, but I want to be careful adding extra install steps. I'm loving Composer and wish there was a way to tap into it for GUI-based installs too. It's definitely an app/theme/library management tool that should be well supported in Elefant (technically it is, just not prominently mentioned and could be made better use of too).

But I don't know yet if we should go all-Composer or maintain the other install/update methods too. I'd like to make app/theme discovery a part of the web installer (was just writing about that actually: #182https://github.com/jbroadway/elefant/issues/182and

183 https://github.com/jbroadway/elefant/issues/183) that would

involve a layer above Composer at least. Those are still just rough ideas though, coming from working on the new Elefant website right now.

I think the GUI experience for app/theme discovery and install is important. A big reason people love Wordpress is the web-based install and update process. I think we can create an even better experience with Elefant :)

To make Composer easier, I wonder if Elefant could have you specify a composer.phar on install, or even bundle its own, so the CLI install/update commands could wrap around that? Hmm...

— Reply to this email directly or view it on GitHubhttps://github.com/jbroadway/elefant/issues/184#issuecomment-16962969 .

jbroadway commented 11 years ago

Nice, I didn't know about composer create-project but it looks like Elefant could be installed that way really easily too. Very cool!

I would love to have Composer take care of updates, and if it could do both apps/themes/libraries and the CMS itself that would be amazing. I definitely want Elefant to have good CLI tools, since they can be automated where a GUI can't.

But due to filesystem permissions within a PHP request, I don't think we can just build a GUI on top of Composer, unless it were to trigger an event outside of the current web request. That would need something like the new Resque app, since you wouldn't want a Cron job calling composer update all the time.

jbroadway commented 11 years ago

So I just installed Elefant via:

$ composer.phar create-project --stability=dev elefant/cms Sites/foo

Cool! :)