php PECL和PEAR有什么区别?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1385346/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What are differences between PECL and PEAR?
提问by shin
I can see that GD library is for images. But I can't see differences between PECL and PEAR. Both have authentication. What are the main differences between two? Why don't they combine them?
我可以看到 GD 库是用于图像的。但是我看不出 PECL 和 PEAR 之间的区别。两者都有身份验证。两者之间的主要区别是什么?为什么不把它们结合起来?
回答by Anti Veeranna
PECLstands 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.
PECL代表PHP 扩展社区库,它具有用 C 编写的扩展,可以加载到 PHP 中以提供附加功能。您需要具有管理员权限、C 编译器和相关工具链才能安装这些扩展。
PEARis PHP Extension and Application Repository, it has libraries and code written IN php. Those you can simply download, install and include in your code.
PEAR是PHP 扩展和应用程序存储库,它具有用 php 编写的库和代码。您可以简单地下载、安装并包含在您的代码中。
So, yes they are similar, but yet so different :)
所以,是的,它们很相似,但又如此不同:)
回答by cweiske
PECLis a repository of C extensions for PHP. Those extensions are usually installed via the peclcommand, which is an alias for pear, with the default channel/repository set to pecl.php.net.
PECL是 PHP 的 C 扩展库。这些扩展通常通过pecl命令安装,该命令是 的别名pear,默认通道/存储库设置为pecl.php.net。
PEAR is multiple things:
PEAR 是多方面的:
- The package installer(
pearcommand) that is able to install packages from different channels (repositories), including pecl.php.net. Many consider composer the successor of the pear installer. - The package repositoryhttp://pear.php.net/packages.phpwith ~600 libraries. Many of them are composer-installable.
- A PHP coding standardthat is available with PHP_CodeSniffer.
- 能够从不同渠道(存储库)安装包的包安装程序(
pear命令),包括 pecl.php.net。许多人认为 composer 是梨安装程序的继承者。 - 包含约 600 个库的包存储库http://pear.php.net/packages.php。其中许多是 Composer 可安装的。
- PHP_CodeSniffer 提供的PHP编码标准。
回答by Hos Mercury
pear is a php classes written in php Whereas pecl is extensions which not written in php and need compiling .
pear 是用 php 编写的 php 类,而 pecl 是不是用 php 编写的需要编译的扩展。
回答by Just another guy
PEAR as-such is not a coding standard. Instead PEAR "follows" a set coding standard that is encouraged within the PHP Community. This is however not the only coding standard that PHP users can follow, the ZF, for eg. recommends a slightly different standard.
PEAR 本身并不是编码标准。相反,PEAR“遵循”PHP 社区鼓励的一套编码标准。然而,这并不是 PHP 用户可以遵循的唯一编码标准,例如 ZF。推荐一个稍微不同的标准。
回答by kguest
PEAR is also a coding standard ;-) php_codesniffer (install via $pear install php_codesniffer ) is a tool that will scan your code and hilight where it deviates from that or any other supported coding standard.
PEAR 也是一个编码标准 ;-) php_codesniffer(通过 $pear install php_codesniffer 安装)是一个工具,它将扫描您的代码并突出显示它偏离该标准或任何其他支持的编码标准的地方。

