问题标签 [symfony-flex]
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.
php - 我的捆绑包没有自动注册
我按照symfony 教程创建了一个独立的包,但是自从我将包从我的应用程序中移出后,就没有任何工作了。
一步一步地,我意识到 flex 不会自动将我的包注册到我的项目中。通常它应该是自动的,因为我的 bunlde include "type": "symfony-bundle"
。我想我在一些命名上犯了错误(在这个问题中),但我不能把手放在上面:
有实验的人可以快速查看以下代码并解释我做错了什么吗?
symfony - Symfony Flex 配方如何知道要安装哪些包?
我试图了解 Symfony 食谱如何知道要安装哪些软件包。
阅读源代码,在我看来,当我运行时
作曲家,将 flex 作为插件,
- 查找名为twig的别名
- 看到它已为配方symfony/twig-pack注册
- 下载配方并读取其 manifest.json
- 执行 manifest.json 中定义的所有操作,例如创建额外文件或将内容附加到文件
但是我在 manifest.json 中看不到安装实际的包symfony/twig-pack。
是否暗示所有配方都必须与他们正在安装的包共享它们的名称,并且这是作曲家知道要安装哪个包的方式?
即开发人员不能只创建一个配方发明公司/不存在的包,它只是在此处添加一些文件并在那里附加几行,但实际上并不对应于packagist 上的包?
symfony - 我们可以在 Symfony 4.3 中从 Rabbitmq Consumer 发送事件吗?
我正在尝试从 Rabbitmq 消费者分派一个自定义事件。这个过程曾经在 Symfony 3.4 上工作,最近将该项目升级到 Symfony Flex(4.3)。
数据集提交消费者.php
数据集提交监听器.php
EntityEventDispatcher.php
还运行了bin/console debug:event-dispatcher
并且事件是可调用的
使用 Symfony 4.3、Rabbitmq 3.3.5
在 Rabbitmq 消费者成功退出后,事件侦听器不会捕获此分派的事件。有没有办法调试或使这项工作?
谢谢。
symfony - 使用 Flex 将 Symfony 3.4 升级到 4.x - Composer 问题
我有一个 Symfony 3.4 项目,我正在尝试使用 Flex 升级到 4.x,但我遇到了第一个障碍。
Composer 的输出如此冗长,我认为答案正直直地盯着我看,但我没有看到它。我需要做什么?我已经删除了 vendor 中的所有内容,删除了我的 composer.lock 文件,清除了 composer 缓存等。
作曲家.json
试图作曲家安装:
php -d memory_limit=-1 /usr/local/bin/composer install
它会吐出所有这些(太大而无法粘贴在这里):https ://pastebin.com/KLVRkYdF
在其他地方看到需要先自行安装 Flex,所以我尝试了这个:
php -d memory_limit=-1 /usr/local/bin/composer update symfony/flex --no-plugins --no-scripts
但出现以下错误(太大无法粘贴到此处):https ://pastebin.com/KxG2siZi
php - 如何使用 flex 安装一个较新的 symfony 软件包
我想在 symfony 3.4 中有一个应用程序,但在 v4 中有 symfony/dotenv。4.4.8 版本中的dotenv 包支持 symfony/process 3.4。
但是当我运行时composer update
,它会失败并且只列出 3.4.* 作为候选版本。这可能受以下限制extra.symfony.require
: 3.4.* in composer.json
.
我知道它至少在某些情况下有效。我在 symfony 3.4 中有一个项目,它使用symfony/http-client 4.3
. 这仅仅是因为没有旧版本才有效吗?
我在哪里可以找到有关依赖限制的更多信息symfony/flex
?
以下是我知道的一些来源:
- https://symfonycasts.com/screencast/symfony5-upgrade/version-constraints#symfony-flex-symfony-extra-require-is-a-soft-requirement
- https://github.com/symfony/flex/blob/master/README.md
- https://flex.symfony.com/
这是最清晰的一个:
什么时候extra.symfony.require
是软要求(来自 1. 的文本),这是什么意思?这是否与 4. 匹配?
composer.json
无法运行的示例composer require symfony/dotenv:^4.0
(使用创建symfony new --version=3.4
):
symfony - 为什么 copy-from-recipe 不会将任何文件添加到我的基础项目中?
我在我的本地电脑(windows)上运行本地 flex 服务器:https ://github.com/moay/server-for-symfony-flex
我用 config/routes/api-form-bundle.yaml 和我的清单做了一个食谱:
我希望在 composer install 之后将 api-form.yaml 文件添加到我的基本项目的 config/routes 目录中,但没有添加任何内容。(别名和脚本工作没有问题)
问题是什么?我写错了吗?
php - Symfony recipes doesn't apply when installing custom bundle
I'm trying to create a re-usable custom bundle following the great course on SymfonyCasts. But when I try to install it with composer, the symfony recipes doesn't apply. For example, my bundle isn't registered at all in config/bundles.php
. I read everywhere that the simple fact of setting "type": "symfony-bundle"
in the composer.json should automatically run the recipes, but in my case it simply doesn't.
The strange fact is the recipes does apply on uninstall. Example :
composer remove chinaskijr/mybundle
prints
But nothing on composer require chinaskijr/mybundle:*@dev
The SymfonyCasts course make us install it through "path" repositories, but I also tried with private gitea repositories and the results was identical.
I also don't think that the issue comes from my bundle cause when I registered it by hands, his code is correctly working.
Here is my composer.json
Thank you very much for answering.
EDIT : I'm not sure the problem is from here because I tried to install it on differents projects, and it never works. Here is on symfony/skeleton for example.
EDIT2 : There is the structure. Once activated by hand, services are autowired, I can access them from the container and get the config
All namespaces are prefixed by chinaskijr\mybundle\
following the PSR-0
php - 我应该在生产代码库上使用 Symfony Flex 吗?
我正在Dockerfile
使用带有 Flex 的 Symfony 5 为我的新 PHP 应用程序编写代码。
我运行的构建命令之一如下:
RUN composer dump-env prod
它给了我错误:
我明白了,因为dump-env
命令来自 symfony/flex 作曲家依赖项,它位于我require-dev
的composer.json
.
我在Dockerfile
:中有另一条指令,RUN composer install --no-dev --no-suggest
这就是我收到此错误的原因 - 我在未安装的情况下运行dump-env
命令。symfony/flex
要修复它,我可以将依赖symfony/flex
项从.require-dev
require
composer.json
所以问题是:
- 我应该在生产代码库中使用 Symfony Flex 吗?
- 如果没有,我如何运行
dump-env
命令来提高生产性能? - 如果是,使用它的其他原因是什么?Flex 会以某种方式影响应用程序的性能吗?
php - 如何在使用 flex 时升级我的 Symfony 应用程序?
我找到了一个我想在我的项目中使用的 Symfony 组件,但它仅在 5.2 版之后才可用,并且我所有的 Symfony 元素目前都在 5.1.10 版中。
我阅读了以下链接:
- 如何升级你的 Symfony 项目(但不是弹性项目)
- 如何将您的项目转换为弹性项目
- 这个链接描述了我面临的相同问题,但没有给出正确的答案。
但是我没有找到如何将我当前的所有 5.1.10 版本元素升级到 5.2。
我试图composer.json
用 '5.2.*' 手动替换我的所有 '5.1.*' 出现,然后运行composer update
,但它不起作用并引发以下错误: