Thursday, November 18, 2010

ruby gem like system for php

With the advent of phar I feel the time is nigh for a ruby gem/perl cpan-esque system for distributing packages/sharing code. I know pear exists but honestly how does one distribute a package via pear? proposals? cvs? I am imagining something where you point it to a github project and it generates a phar, increments the version number, when ever you tell it a release is viable.

It would also be slick to be able to do something like:

rock::require('somePackage');
namespace somePackage;

funcDefinedInSomePackage();
$x = new ClassFromSomePackage;


Where rock::require at dev time would check for the latest version of "somePackage" on the server, if it is newer than what is there (or it is not there at all) it will download the phar, put it in the library and then load the phar.

2 comments:

Lee said...

I agree. But since I am the only commenter in 2 years on this I suspect it's unlikely to happen. :( PHP has 2 big problems, in my opinion. There's no real dependency management system (like ruby gems for ruby/rails) and hosting companies are VERY slow to upgrade to new versions of PHP. So you end up pretty much always re-inventing the wheel and trying to support 5 year old technology.

Lee said...

After leaving my first comment, I came across this post and found it very interesting. I thought I'd share it here too: http://philsturgeon.co.uk/blog/2012/03/packages-the-way-forward-for-php