Wonderful World of Composer
Dive into the world of Composer! Learn to install external libraries, handle autoloading, and manage dependencies for your PHP projects.
About this course
Welcome to the wonderful world of Composer - the Dependency Manager for PHP!
In this Screencast, you'll learn how to install and configure Composer and use it to integrate third-party libraries into any PHP project (even something like Wordpress!). This includes:
- How Composer makes sharing awesome again
- Downloading the composer.phar file
- Creating the composer.json file
- Installing the external libraries
- Handling autoloading
- Understanding the
composer.lock
file - The
update
versusinstall
command - The
require
command - Storing in version control
Let's go!
Next courses in the OOP: Go Further section of the OOP Track!
14 Comments
Great job! This is an excellent place for anyone to start! Thanks!
I'll be linking folks to this regularly when they have questions on Composer -- really nice work!
Great Job, I´m planning following all your Symfony2 tutorials!
Although I have a question:
WHere does lives the "list_files.module" file... ? I´ve searched through all the drupal directories and files and Couldn´t find it :)
Hey Edison!
Oh man, *great* question! I realize that I didn't put very good comments on that file in the script :). I've just made some changes to show you were this is (https://github.com/knpunive... - you should already see these deployed! Basically, I'm putting things into a custom module called `list_files` that I already created and enabled before the tutorial.
I hope that helps! And good luck with the tutorials - ping me if you need anything!
Cheers!
Confused noob here. I installed composer on my local machine but I cannot figure out how to install it on my web server. I do not have curl. Can anyone help? I'm trying to use a MailChimp plugin that requires composer
Hey Rachel!
No worries :) - you have 2 options:
1) The second code block on the download page - https://getcomposer.org/dow... - shows an option that *doesn't* use curl. This may work for you!
2) Since composer is just a single file (composer.phar), you can just upload this to your web server. You could even commit it to your version control repository - It's generally not considered a best practice, but it's no big deal.
Good luck!
Great video. I was always confused by the behavior of composer install and composer update. Thanks!