Just Enough Composer To Be Dangerous

Note: this is an archived site. The current site can be found at http://drupalcampla.com.
Day: 
Saturday
Time: 
2:30p
Room: 
Doheny Beach A

You've heard of Composer, and you've seen composer.json files, but maybe you're unclear how any of this is really useful. Come and find out.

I will live-demo build a completely trivial PHP command-line app using the Symfony Console, without ever opening a tarball or figuring out which PEAR channel to update. Along the way we'll answer some questions:

  • What is Composer?
  • Why do I need it?
  • What problems can we solve with it?
  • PSR-What?

If you want to follow along, you'll need two things:

  1. Be able to type php --version at your command prompt and see version 5.3.2 or later.
  2. Type which curl and get a result.

I'll be using a Mac to show you what to type and when.

Note that I've posted a 'blog with the content, which you can follow along: http://mile23.com/content/enough-composer-be-dangerous

Yes, that's right, there's no slide deck. :-)

Category: 
PHP
Skill: 
Beginner
Duration: 
One hour
Session Tags: 

Comments

I am just getting into learning composer. So the talk was helpful. Here's a link to the PDF documentation.

https://getcomposer.org/book.pdf

Here's a question for you. I have been trying to get Jesus Olivas's DrupalAppConsole downloaded. But composer timed out (default is 5 minutes/300 seconds) on "drupal/drupal" and left me IN THE MIDDLE OF THINGS. I tried to resume installation, but didn't want to redo the whole job, so I settled on updating from there, with the timeout value reset. Like this:

$ COMPOSER_PROCESS_TIMEOUT=4000 composer.phar update drupal/drupal

Is there a better way to RESUME a composer download that has timed out or experienced some other error?

I'm pretty sure the concept of resuming doesn't exist in composer. Just do a composer update and let it try again. If you're worried about incomplete downloads, delete the vendor/ directory.

There are a few points of failure: Your internet connection, the drupal/drupal entry on packagist.org might be in error, git.drupal.org might have been down, or the console app might have some script that does a bunch of crazy stuff when it's downloaded.

Good luck!

Thanks for the response. That's what I thought. "drupal/drupal" is a large package, and I was on a slow connection (but it updated fine with the time set more liberally). It would be good for people to note that they have large components in the mix when they post them, so that people set an appropriate time.