Re: Questions about PEAR/PackageFileManager2.php
| From: | Dmitri | Date: | Thu, 03 Jan 2008 20:24:11 +0000 |
| Subject: | Re: Questions about PEAR/PackageFileManager2.php | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-28392@lists.php.net to get a copy of this message | ||
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));
}
This worked for me.
Dmitri wrote:
Hello! I am creating my first package that should be installable with pear installer I am using PEAR/PackageFileManager2.php I want to add the replacement task <tasks:replace from="@package_version@" to="version" type="package-info" /> but only to php files I added this line to my createxml.php file which uses PackageFileManager2.php: $pfm->addGlobalReplacement('package-info', '@package_version@', 'version'); but now it added the replace task to all files, even to html files. How can I limit adding this task to php files only? Question2: I my project directory structure I have directory /classes/ where all the classes are located. In the actual package I don't want to have this extra directory and want all classes to be installed in the package root directory So, it my package name is SHAREDLOG, then I think the package will be installed (at least on my server) in /usr/local/php/lib/php/SHAREDLOG/ How can I make it so that all the files from /classes/ dir be moved to root dir? I know I can use install as, but this will require to manually add this 'install as' to every file in classes dir. I have many classes there. Is there a way to use install as for a whole directory? Thank you.-- Open Source ALL content management with streaming video http://wiki.sharedlog.com