PhpRiot
News Archive
PhpRiot Newsletter
Your Email Address:

More information

PHP Components: ComponentManager-1.1.0 Released

Note: This article was originally published at Planet PHP on 5 April 2011.
Planet PHP

In my Beyond Frameworks talk, I explained how a component-based architecture can help answer some of the important (i.e. expensive!) questions you might face when creating long-lived apps that rely on a PHP framework. In this series of blog posts, I'm going to look at how to go about creating and working with components.

I've just put out ComponentManager version 1.1.0, with the following (hopefully useful) changes:

Improvements To The php-library Skeleton

  • Once you've setup your metadata, phing build-vendor will build with no errors.

    I've added an empty src/php/dummy.php file, so that a valid empty PEAR-compatible package can be build and installed. You'll want to remove this file when you start putting your own code into the component.

  • New build.property: project.channel. Set this to the name of your PEAR channel. Automatically picked up by package.xml now.
  • New build.property: pear.local. Set this to the folder where your local copy of your PEAR channel resides. (See my blog post for details about why you might want a local copy of your PEAR channel).
  • New build.xml target: publish-local. You can now do phing publish-local to use pirum add your component to your local copy of your PEAR channel.

Bug Fixes For The php-library Skeleton

  • Now tested on both Ubuntu and Fedora 14, especially for @phpcodemonkey.
  • Now excludes .DS_Store folders from the final component, for those using these tools on OS X.
  • Now excludes .svn folders from the final component.
  • Now excludes .empty files from the final component.

How To Upgrade

To upgrade your installation, please do the following:

$ pear clear-cache $ pear upgrade pear/pear $ pear upgrade Gradwell/ComponentManager

Once the latest version of ComponentManager has been installed, you can upgrade the skeletons of your existing components by doing:

$ cd / $ phix php-library:upgrade .

You will then want to edit build.properties, to set the new properties added in this release.

Any problems, let me know.