I figured out how to do add replacements to only files in 'classes' directory and also how to install the 'classes' directory without using the actual directory.
Like this in the makexml.php
foreach (glob("classes/*.php") as $file)
{
$pfm->addReplacement($file, 'package-info', '@package_version@', 'version');
$pfm->addInstallAs($file, '/'.basename($file));
}
Indeed, it would be handy to add the glob() thing to PackageFileManager::addReplacement().
I have filled a feature request (with a patch) here:
http://pear.php.net/bugs/bug.php?id=12820
David <izi@php.net>