2

This may look like a trivial question, but it isn't.

Being new to composer, I find myself wondering about how to pick a decent package for a common feature on its main repo packagist.

Say I am using Laravel 4 for a recent project and would like to add mongodb support for document storages and indexing. A simple search for mongodb on packagist will yield 8 pages of results, searching for mongodb laravel yield 24 pages.

But here comes my question: most packages have their target framework, should I pick the ones that are less popular but designed for Laravel, or should I go with the popular package in hope of future maintenance?

My assumption is that: composer, along with PHP-FIG standards, are attempting to reduce repeat development of common features across frameworks. So eventually there maybe only a handful of popular package left active for a certain common tasks.

But for now, how to choose the right package on packagist for framework X? Should we just search on github instead?

(I should note that Laravel already use a handful of Symfony/doctrine packages in core, but there are no guarantee that doctrine/mongodb will also work in Laravel without modification right?)

4

2 回答 2

2

当我在 Packagist 上搜索时,我尽量避免依赖于不是 Laravel 或有时是 Symphony 的框架的包。当然,没有框架依赖是可以的。

当 L4 还处于 alpha 阶段时,我想玩弄图像处理。经过一番调查,我选择了 sybio/image-workshop。当时,还没有与 Laravel 完美交互的包。创建服务提供者和门面后,一切都很好。

在 packagist.org 上,尝试不带引号的搜索词“mongodb AND laravel”。在这种情况下,这会将搜索范围缩小到一页。

Chris Fidao (@fideloper) 在 5 月 2 日发布了关于 Laravel 的以下 MongoDB 包的推文。它使用 Eloquent 看起来很有趣。

https://github.com/jenssegers/Laravel-MongoDB

于 2013-06-03T12:38:49.810 回答
0

对于 laravel 框架的特定包,请检查packalyst。Packalyst 是 Laravel 项目的 Packages 目录,它从Packagist中提取具有“laravel”标签的包名(composer.json 中关键字数组中包含 'laravel' 的作曲家包)。

于 2017-02-10T10:17:34.550 回答