This week, at Atrápalo, we have reviewed our autoloading Composer configuration to use PSR-4 and split production classmap from development classmap to save some space in our Opcache. The result, 500 Kbytes less. Let’s see some details.
With the Domain-Driven Design, Microservices and API explosion, I see more teams working in a base project, such as a Web, and integrating other private packages they develop in a different repository. For example, working on the Web and an API client for a external REST service at the same time.
For example, at @AtrapaloEng, our sales development team (checkout process, purchases, orders, payments, etc.) integrates different payment methods into the web so users, specially Latam ones, can be happier using their preferred payment methods. They create a repository for each of the new payment methods we support as a external package. Sometimes a developer in the team must work with different projects at the same time, the Web and the payment method in development.
In this scenario, one option is work on the payment package, tag, push, go to the base project and update dependencies with Composer. As you can see, it’s a bit slower, how we can improve this process? Composer to the rescue!
Rascando por Youtube, encontré este vídeo de 2014, de una presentación que hice en LaSalle inspirada por otra que hice en Castellón en 2011. La idea es hacer un overview del ecosistema PHP y puntos importantes a la hora de montar un ciclo de desarrollo basado en esta tecnología. Que la disfrutéis.
After talking about Technical Committee and Training Sessions in the previous post of the series, today, I’ll carry on with adding Composer to legacy projects without pain.
The day I left Emagister, I was sat down with Eber and Christian having beers and talking about all the cool things we did there. We were reviewing each of the changes, it cost, benefits, feelings in the team, etc. When I said, “what about composer? that was cool!”, Eber said, “Composer is not just cool, it’s a must.”. As always, he was too right. It has been also the first thing done at Atrápalo.
Starting with a brand-new project using create-project command it’s easy, but, what about those developers dealing with a big legacy project, with custom autoloader, PEAR dependencies, hardcoded fixes in a external library, non PSR-0 code, etc. Don’t worry, you can also take benefit of Composer. However, there are some tricks you should take care of in order to face those issues.
Packagist is a Composer package repository. It aggregates all sorts of PHP packages that are installable with Composer. You can use Composer to manage your project or libraries’ dependencies. Read more at http://packagist.org.