문제

I am working on a PHP application that uses many features from PEAR. The app is meant to be distributable kind of like Wordpress but really scaled down.

Now the problem I've run into is that PEAR needs to be installed and configured alongside the PHP server without which my app simply will not function unless the users go through all the painful steps of installing PEAR on their server. Users can very well be newbies or non-technical so it's not an option for them.

Therefore there is a need to somehow package everything PEAR into the application itself. As far as I know it may not be possible.

Are there any alternate solution to this? Any solution at all will help. Thanks..

도움이 되었습니까?

해결책

PEAR installs system wide dependencies which makes things like what you describe hard. Composer on the other hand is exactly what you'd need, because it's a per-project dependency manager with much better support for resolving and installing of dependencies. Basically, compared to Composer, PEAR sucks... it always did, Composer on the other hand rocks!

The first thing I would do for each package you need is to see if it is also provided on https://packagist.org/. If it is, problem solved, include the installation into your build process with composer. If you end up with only a few packages from PEAR, you have several options:

  • inspire the author to provide it on packagist
  • make your own mirror on packagist (not recommended but sometimes necessary)
  • see if the project is on github and install directly from git with composer
  • install the PEAR package via composer anyways, it's possible.

Short answer: switch to composer!

다른 팁

If you are talking about the PEAR packages or class files, you can put the PEAR packages anywhere you want. Just put the ones you use into a dir within your app dir structure and add that to the include path.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top