Jump to content

Bundling PEAR


Recommended Posts

I am able to install PEAR with not problems, but I would like to be able the pear modules with my distributable application and have my install program finalize the paths.

 

can any one tell me how this can be done ?

 

Regards

 

JY

Link to comment
Share on other sites

PHP itself can't install PEAR.

You might have to specify PEAR as a requirement for your application.

 

php.ini will hold the path to PEAR so you don't have to worry about your application figuring out the paths.

 

 

 

 

 

you can also try this...

Package the PEAR base along with the modules that you need with your application. And within your application, use ini_set() to set the 'include_path' to point to the directory where you packaged your PEAR base and modules.

 

I recall there is a strict folder structure you have to follow when installing PEAR manually (manual installation is apparently not recommended) and this was on the FAQ of the PEAR site a long time ago. I can't verify this because any subdomains of php.net haven't been working for the last 24 hours for me but this may be due to my geographical location so give it a try yourself: http://pear.php.net

Link to comment
Share on other sites

What I am looking to do is have PEAR "installed" in APLICATIONBASE/lib/PEAR.  unzip/tar the whole application and then have min install.php set the APLICATIONBASE variables.

 

The problem is that I thought that PEAR has some full (ie no relitive) paths in it's registry? 

 

Julian

Link to comment
Share on other sites

i believe PEAR stores it's configuration (registry, as you call it) in a .pearrc file.

most web applications don't have enough permissions to make those changes. if they do, that's not a good thing.

 

 

 

when PHP uses a PEAR class, you simply give the package folder's name and then the class name as you may already know...such as:

include 'Crypt/BlowFish.php';

 

 

that's because the path to the PEAR base folder (i.e. where PEAR and the Crypt folders reside) is set in php.ini's include_dir directive.

 

so you can use ini_set() to set include_dir in your application. at the installation point, you would have to ask the user to enter the path to their PEAR installation and set that in your application.

 

 

 

i just had a look at the PEAR site, it says that manual installation is not advised so you might want to reconsider encouraging manual set up of PEAR by packaging the PEAR libs.

see: Manual installation

 

 

however, i don't see a problem packaging a PEAR module with your app and setting the include_dir path as i mentioned above...but i wouldn't attempt to set up the PEAR base within my application.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.