Jordi Boggiano: Composer goes Gold

Jordi Boggiano has posted some excellent news for all of the Composer users out there – the widely popular dependency management tool has officially "gone gold" and has tagged the stable v1.0.0 version of the tool.

Five years ago today, Composer was born. In some ways it feels like yesterday, at least it doesn’t feel like five years went by. In other ways it seems like a lifetime ago, and I can barely remember what it was like to write PHP code without having a whole ecosystem at my fingertips.

Jordi talks about one big change that happened recently around the "self-update" feature of the tool. He hopes that more people will use the preview or snapshot channels in their deploys/development so he can get more information about these other options before they get to stable. Finally, to mark the occasion Jordi has put a "gold" copy (on floppy disk none the less) up for sale on eBay to commemorate the release.

SitePoint PHP Blog: Drunk with the Power of Composer Plugins

The SitePoint PHP blog has a new tutorial for the Composer users out there talking about Composer plugin development and how they can add functionality to this already powerful tool.

Composer is the sharpest tool in the toolbox of the modern PHP developer. The days of manual dependency management are in the distant past, and in their place we have wonderful things like Semver. Things that help us sleep at night, because we can update our dependencies without smashing rocks together.

[…] Even though we use Composer so frequently, there’s not a lot of shared knowledge about how to extend it. […] Yet, recent changes have made it much easier to develop Composer plugins. […] So, today I thought we would explore the possibilities of Composer plugin development, and create a fresh bit of documentation as we go.

He walks you through the creation of a simple plugin: one that tracks users and the dependencies they require. He shows you how to create the initial plugin boilerplate and the creation of the addDependencies and activate methods. These grab the dependencies being added and send the information off to a remote site.

Andrew Embler: Q&A: Using Composer in a concrete5 Package

Andrew Embler has posted a guide to his site showing you how to use Composer with concrete5 to integrate third party libraries quickly and easily. concrete5 is an open source content management system under the MIT license and is flexible and easy to extend.

Let’s say I’m creating a statistics package and I want to use LavaCharts in it. For those who don’t know, LavaCharts is a PHP library that abstracts Google’s JavaScript Chart API to PHP. Instead of writing JavaScript, you build your charts with object-oriented PHP. It’s nice. LavaCharts is available through Composer, so I’ll include it that way.

He uses this particular package as an example, showing you how to create the composer.json file to include the LavaCharts library and run Composer to install it. He then shows the integration of the package with the concrete5 CMS instance, including the Composer autoloader in the "on start" handling. From there it’s just a matter of referencing the library via its namespace and using it to populate and generate the resulting chart.

Engine Yard Blog: Composer & Continuous Integration

In a new post to the Engine Yard blog Nils Adermann provides an overview of using Composer with continuous integration, its role in the overall process and some good practices to follow in its use.

Continous Integration (CI) is the practice of continuously (and automatically) testing every change a developer makes. So automated tests become an integral part of the development process providing direct feedback on changes made. […] Davey Shafik’s article on Composer’s Lock File explains the typical usage of composer install and update. The key takeaway is that developers should run composer update manually to explicitly update individual dependencies while composer install should be used in automated processes. This principle includes automated test environments.

He points out that using the lock file method reproduces the vendor directory exactly as it is in production and what it means for failures in your automated tests. He also talks about methods to improve the build performance to reduce time spent during the generation of the environment, including the use of the Composer cache data. He includes a few flags you can pass to Composer to reduce not only the libraries it installs but also how it fetches their contents.


Made With Love Blog: Tilde and caret version constraints in Composer

The Made With Love blog has posted a great introduction to version handling in Composer today. They focus in on two characters that can be confusing if you’re not exactly sure what they mean – the carat (^) and tilde (~).

A dependency that uses semantic versioning allows you to predict wether it is still going to work or not when you upgrade it to a new version. Basically when the x in a x.y.z version number changes, you might need to do some changes to be able to work with this new version without problems. […] Depending on your dependency manager you can define version constraints using wildcards (*), comparators like < =, logical operators (, often means AND and | means OR), etc. [...] There are also some syntactic sugar operators like ~ (tilde) and ^ (caret)

They include some examples of both characters in use defining the required install versions, showing how one allows for approximate matches and the version ranges they apply to.


Engine Yard Blog: Engine Yard Is Sponsoring Composer

According to this new post to the EngineYard blog, they’re announcing their formal sponsorship of a tool that has revolutionized the way PHP libraries and packages are used: Composer.

Open source is a big deal at Engine Yard. Originally founded as a Ruby company, most of our early work was in the Ruby community. Since acquiring Orchestra in 2011, we have been investing in the PHP commmunity and are continually on the look out for ways to give back. So I’m thrilled to be sharing the latest news on this front. […] We care a lot about PHP and we want to continue our mission of supporting key pieces of infrastructure in the communities we serve.

Their support is coming in the form of a community grant provided over the next twelve months. This fund ($ 15k) will provide support for the continued development of the project and Nils Adermann, one of Composer’s principal developers.


Gonzalo Ayuso: Kombinieren Zend Framework2 und Symfony2 Komponenten mit Composer PHP Projekte zu bauen

In seinem jüngsten Beitrag Gonzalo Ayuso zeigt Ihnen, wie in das gleiche Projekt mit Composer .

Zend Framework 2 ist endlich stabil . Ich muss zugeben, dass ich nicht bin ein großer Fan von ZF (oder sogar Symfony2) als Full-Stack Rahmen. Ich normalerweise lieber micro Frameworks verwenden, aber diese beiden Frameworks (ZF2 und SF2) sind groß, wie Komponenten-Bibliotheken. Heute werden wir eine einfache Konsolenanwendung (mit symfony / console Komponente) zu bauen, um die Liste Datenbanktabellen (mit zendframework / zend-db ’s Metadaten).

Er beginnt mit der Informationen, die Sie brauchen, um in Ihrem „composer.json“ Datei ablegen, um die benötigten Pakete (und bis der Autoloader ein Bit gesetzt) ​​bekommen werde. In der Post ist der Code seine „SchemeCommand“-Klasse zu erstellen, um den neuen CLI-Befehl, eine, die in einer Datenbank und Echos aus dem Metadaten über die angegebene Tabelle verbindet machen. Ein Unit-Test ist ebenfalls enthalten.

Henri Bergius ‚Blog: Composer löst das PHP-Code-Sharing Problem

Henri Bergius hat einen neuen Beitrag in seinem Blog heute über ein Tool, das dazu beitragen, dass die Wiederverwendung von Code in PHP-Anwendungen viel einfacher verarbeiten konnte. Die Composer Werkzeug (und Packagist ) machen Einstellung up-Pakete und Abhängigkeiten einfach.

In PHP hatten wir ein lausiger Kultur Code-Sharing. Denn je nach Code von anderen wie schon tricky, hat alle wichtigen PHP-Anwendung oder Rahmengesetz hatte praktisch die ganze Welt neu zu implementieren. Nur einige Tools, wie PHPUnit , haben es geschafft, über diese Barriere zu durchbrechen und zu de-facto Standards in Projekt hinweg. Aber für den Rest: nur es selbst schreiben. Aber jetzt Composer , und seine Repository Gegenstück Packagist , versprechen, alles zu ändern. Und natürlich neue Konventionen wie PHP Namensräume unterstützen und die PSR-0 Standard-Autoloader zu helfen.

Einen Paket ist so einfach wie die Einrichtung eines JSON-basierte Konfigurationsdatei, die Abhängigkeiten und Paket-Metadaten (wie Name, Typ usw.) Namen. Composer generiert einen Autoloader der eigenen, um das Laden der Ihre Bedürfnisse auf der Grundlage der Abhängigkeiten als Teil des Pakets aufgelistet Griff. Wenn Sie weitere Informationen über Komponist möchte oder auf die neueste Version zu bekommen und es selbst ausprobieren, lesen Sie des Projekts github Repository .