News Feed
Sections




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

Henri Bergius' Blog:
Composer Solves The PHP Code-Sharing Problem
November 02, 2011 @ 16:28:25

Henri Bergius has a new post to his blog today about a tool that could help make code reuse across PHP applications a much simpler process. The Composer tool (and Packagist) make setting up packages and dependencies easy.

In PHP we've had a lousy culture of code-sharing. Because depending on code from others as been tricky, every major PHP application or framework has practically had to reimplement the whole world. Only some tools, like PHPUnit, have managed to break over this barrier and become de-facto standards across project boundaries. But for the rest: just write it yourself. But now Composer, and its repository counterpart Packagist, promise to change all that. And obviously new conventions like PHP's namespacing support and the PSR-0 standard autoloader help.

Making a package is as simple as setting up a JSON-based configuration file that names dependencies and package metadata (like name, type, etc). Composer generates an autoloader of its own to handle the loading of your needs based on the dependencies listed as a part of the package. If you'd like more information about Composer or to get the latest version and try it yourself, check out the project's github repository.

0 comments voice your opinion now!
code sharing composer package psr0 packagist namespacing


blog comments powered by Disqus

Similar Posts

Stoyan Stefanov's Blog: Performance tunning with PEAR::DB

Matthias Noback: The "dark" side of PHP

Designer Daily: 8 useful recipes to improve your WordPress theme

Pierre-Alain Joye's Blog: Welcome Amir and Validate-0.6.4 release

VitalFlux.com: Top 10 PHP Code Review Tips


Community Events

Don't see your event here?
Let us know!


laravel php7 series podcast community release unittest example framework language voicesoftheelephpant opinion library api video interview laravel5 introduction version list

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework