Re: Embedding pear

From: Date: Sun, 10 Dec 2006 23:33:11 +0000
Subject: Re: Embedding pear
References: 1  Groups: php.pear.core 
Request: Send a blank email to pear-core+get-5247@lists.php.net to get a copy of this message
asingh@cs.tcd.ie wrote: > Hi guys > > Probably this is not the best list for this query as it is not directly > related to development of pear. However the people in this list might be > best suited to answer my query so I am posting here. > > I have to install pear packages from within a java program (ie you give a > package name) and the java program will install the pear packages. I do > not want to embed the pear cli program in the java code to install the > packages. What I understand is that during the installation the pear cli > resolves all the dependenceies and install the required extra packages. > Installation would involve downloading and unpacking the packages to a > directory and probably adding the directory to the php installation's > include path. Is there anything else that pear does that I should plan > for?? > > I would be thankful for your advise help. Hi Atul, PEAR will attempt to locate a configuration file, unless you pass one in explicitly. I would recommend creating a simple script yourself based on the pear.sh script (http://cvs.php.net/viewvc.cgi/pear-core/scripts/pear.sh) that simply passes in the hard-coded path to the script and expects the name of a package. The command line should hard-code in options as if you had typed: pear -c /path/to/pear.ini -C /path/to/pear.ini upgrade -o <packagename> You should also note that the command will automatically install and upgrade dependencies. If this is undesired behavior, also pass in the -n option, or --nodeps. The pear.sh script will not be changing, it is quite straightforward and the way that it calls the PEAR code is not going to change either, so you can rely upon the script working for all future PEAR 1.x package releases. You should also make sure that the user running java has write access to all of the installation directories, and you should explicitly set the "download_dir" variable to a unique, writeable location, otherwise there may be strange problems. Let us know if this helps. Thanks, Greg

« previous php.pear.core (#5247) next »