Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

BugSnag:
Building maintainable PHP apps using Composer
Apr 03, 2017 @ 12:14:02

The BugSnag blog has a post by guest author Graham Campbell sharing some best practices when using Composer in your PHP applications. It's written mainly for those that haven't used Composer much yet and want to get started quickly and easily.

Composer has made big waves in the PHP community in recent years. Thanks to Composer’s creators, Jordi Boggiano and Nils Adermann, Composer has become the absolute backbone of PHP’s package infrastructure today.

In this blog post, we shall be introducing Composer, from the ground up. We will see what packages are, how they should be versioned, and how to install them into your application. Learn about Composer and never look back!

He starts out by defining what a package is in the world of Composer and how it differs from a "library". He then briefly touches on the early days of the tool before showing how to get it installed and creating your first "composer.json" configuration file. He then gets into one of the more tricky subjects when dealing with Composer and packages - versioning. Finally he covers a few of his suggested best practices when using Composer including defining your own package installation constraints and how the autoloading works to your benefit.

tagged: composer bestpractices introduction configuration package library tool

Link: https://blog.bugsnag.com/best-practices-using-composer/