2016/09/15

Difference between PEAR,PECL and Composer

PECL:( PHP Extension Community Library)


PECL stands for PHP Extension Community Library, it has extensions written in C, that can be loaded into PHP to provide additional functionality. You need to have administrator rights, a C compiler and associated toolchain to install those extensions.

PEAR:( PHP Extension and Application Repository)


PEAR is PHP Extension and Application Repository, it has libraries and code written IN php. Those you can simply download, install and include in your code.

COMPOSER:


Composer is a dependency management tool in php.

--------------------------------------------------

Use case:


PEAR is soon going to be deprecated.

Using PECL you can install old php extensions, if you are not able to install those extensions from ubuntu repository.

For example your server is running ubuntu LTS 14.04 and php version is 5.3, you will not be able to install oauth by apt-get install php5-oauth. It will give error.

You can use composer in your own project to manage external libraries and dependencies. Composer has https://packagist.org/ to use different php libraries.

--------------------------------------------------

參考資料 : 

沒有留言:

張貼留言