Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Including Pear Libraries in PHP Frameworks

How should PEAR libraries be incorporated as packages / libraries within PHP frameworks?

Namely, I'm using a package system within a PHP framework - and need those PEAR libraries to be easily redistributable (I'm referring specifically to CodeIgniter's package manager, Sparks) to other users. Would it be better to couple the needed PEAR libraries and their dependencies within the package itself, or to instead do a check when the package is initialized (ie constructor, init, factory, whatever called) and prompt (along with download instructions) that that user install the necessary dependencies?

The latter option may not work for some users who lack either the necessary permissions (ie shared hosting?) or the necessary technical knowledge (don't laugh, I'm serious) to install PEAR libraries, ie framework users, not programmers / system admins.

Coupling opens the risk of code duplication within a project, even if it greatly simplifies making the package "just work". What route would YOU take?

like image 918
Calvin Froedge Avatar asked Jul 06 '11 06:07

Calvin Froedge


People also ask

What is PEAR in PHP with example?

PEAR means “PHP Extension and Application Repository.” It is a framework and distribution system for reusable PHP components. It extends PHP and gives a higher level of programming for all web developers. PEAR is divided into three different classes that are: PEAR Core Components, PEAR Packages, and PECL Packages.

What is a PHP PEAR package?

Overview. PHP PEAR packages are software components that developers write in the PHP language. The PHP PEAR Packages interface allows you to search for and add PEAR packages to your website, or view all of your website's available PHP packages.

What is PEAR in xampp?

PEAR is a dying distribution system (just my 2 cents). We don't provide any support via personal channels like PM, email, Skype, TeamViewer! Altrea AF Moderator Posts: 11658 Joined: 17. August 2009 13:05 XAMPP version: several Operating System: Windows 10 Pro x64.

What is PEAR in PHP Quora?

PEAR is a framework and repository for reusable PHP components. PEAR stands for PHP Extension and Application Repository. It contains all types of PHP code snippets and libraries. It also provides a command line interface to install "packages" automatically.


1 Answers

Use Pyrus, the next-gen pear installer and follow the instructions in Using Pyrus To Manage PEAR Installable Vendor Libs.

like image 61
cweiske Avatar answered Nov 01 '22 18:11

cweiske