问题标签 [packagist]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
9622 浏览

php - 你如何让作曲家安装非作曲家包?

我试图让作曲家从这个项目下载以下库,但是,它没有composer.json文件,所以我不确定这是否可能。

错误:

[Composer\Repository\InvalidRepositoryException]在https://github.com/fguillot/picoFeed
的任何分支或标签中找不到有效的 composer.json ,无法从中加载包。

0 投票
2 回答
1546 浏览

php - PHP Composer: choosing the right package for Laravel (or other framework)

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?)

0 投票
1 回答
613 浏览

php - 当多个组件在同一个 vcs 存储库中时使用 Composer

我有一个 git repo,其中包含一些小型和相关的库。由于我正在使用的平台缺乏适当的依赖管理,因此处理许多 git 存储库很麻烦,因此我的团队决定将它们放入一个 git 存储库中。我现在正在努力让我们的软件可以通过Composer安装。然而,我不清楚如何在这个 git repo 中注册每个组件,因为我什至不确定每个 repo 是否有可能有一个以上的 composer.json 文件。这可能吗?如果是这样,怎么办?

0 投票
1 回答
127 浏览

php - 在 composer.json 中指定自动加载

我开始使用 Composer 并且对如何指定应该如何自动加载东西有点困惑。

我最初的假设是定义如何在这个包中自动加载一个包的类。然而,我的印象是应该在使用包的项目中指定这一点。是这样吗?

我希望不是!我不希望库的用户知道这个库的自动加载是如何工作的,例如类位于哪个目录中。例如,我不希望某些客户知道“MyLibrary”的类位于名为“includes”的目录中:

另一方面,如果我目前的印象是错误的,因此我最初的假设是正确的,那么我的问题是如何实现这一点。我尝试在我的一个库的 composer.json 文件中使用以下内容,但是在将其安装在某处后,生成的自动加载类映射中不会显示任何条目。

0 投票
2 回答
4618 浏览

versioning - Composer/Packagist 没有给我最新的包裹

如果你去https://packagist.org/packages/geekality/website并将其与运行 `composer show geekality/website.

  1. 顶部packagist的最新版本是v0.7
  2. 命令行输出中给出的最新版本是 v0.6
  3. 在这两种情况下,最新版本都应该是 v0.7.1
  4. 版本 >= 0.7 甚至不会出现在命令行中
  5. dev-master 版本指向 v0.5 ??

这里发生了什么?我该如何解决?如果我将 composer.json 更改为目标版本/标签 0.7.1,对我来说,这显然存在于 packagist 和 GitHub 上,我会收到一条错误消息,指出找不到请求的包。

我努力了

  • 删除供应商文件夹并重新更新
  • 删除作曲家缓存
  • 在另一台计算机上更新作曲家
  • 在 Packagist 上删除并重新创建包
  • 创建并推送新标签(0.7.1与0.7基本相同)

有人知道发生了什么吗?


更新

似乎这是由 Packagist 的一些问题引起的,而我这边(或其他似乎有同样问题的人)实际上并没有错。

我通过在composer.json.

0 投票
1 回答
837 浏览

laravel - 在 Laravel 中使用来自 Packagist 的 css 包

packagist.org 上有很多 css 包

例子:

将包添加到 composer.json 并运行 composer update 后,该库将加载到vendor/文件夹中。

将 css 和 js 源移动到public/文件夹的最佳做法是什么?

0 投票
1 回答
1412 浏览

composer-php - 作曲家和站点配置文件

进行作曲家安装/更新时,是否可以从“供应商”目录中安装文件?

如果您不确定我的意思,让我再详细说明一下。

我有一个存储在目录中的配置文件/config/ini/<filename>.ini和许多供应商模块vendor。是否可以将 ini 文件与供应商包一起打包,以便在安装时将它们写入正确的目录?

理想情况下,我需要能够实现这一点,因为我有一个身份验证供应商模块,需要安装在各种不同的应用程序中。能够做到这一点意味着私钥和其他共享配置选项可以与供应商模块一起存储(在私有 repo ofc 中)。

谢谢迈克

0 投票
1 回答
839 浏览

symfony - Force an old dependency to be installed with Symfony

Updating to Symfony 2.3 is easy if all the dependencies support it. One of the dependency I am using from Packagist says its requirement is Symfony <2.3. Therefore, I cannot install that library.

The library is a little old, and I know there is one or two problems, however, I wish I could still install it with composer.

How can I force composer to install the library dev-master even though packagist says <2.3 ?

0 投票
1 回答
743 浏览

git - 使用 bitbucket 在 packigist 上创建 composer 包

我一直在建立自己的自我教育框架,并试图将其设置为与作曲家一起工作。我将它上传到bitbucket并创建了一个packagegist,但是当我尝试在我的 windows 上的 netbeans 上安装它时出现错误'git' is not recognized as an internal or external command, operable program or batch file。依赖项可以正常加载和安装,我看到 twig 和其他包等具有源、问题和其他链接。我怎样才能设置它像其他人一样工作?

我知道有些只能通过 git 安装,但我想让我的包可用,而不需要 git 在 Windows 上是全局的。

0 投票
1 回答
3280 浏览

composer-php - Satis update via cronjob

I'm try to update my private repository via a cron job but nothing seems to be happening. I'm using Satis to create the repository for my private packages.

I can do this manually by logging into my account via SSH and running:

which updates everything fine apart from I have to enter my passphrase a million times. I can get round this by using SSH Agent and think this may be my problem...

Is there anything I'm missing?

UPDATE

It is the SSH auth as I've received this error via email (shortened version)

Reading composer.json of vendor/package (master)
Failed to update git@bitbucket.org:vendor/package.git, package information from this repository may be outdated (Permission denied (publickey). fatal: The remote end hung up unexpectedly error: Could not fetch origin )

In the docs it says about using -n to use the SSH Key but I am using it.

Any ideas?

UPDATE

Thought I would add my satis file structure:

really stuck on this one, the documentation is crap!