Git:找不到供应商中的文件 [英] Git: Files in vendor are not found

查看:230
本文介绍了Git:找不到供应商中的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的项目中使用 Symfony2 ,并切换到前几天我的分支 EXAMPLE-123 。我将分页与 KnpPaginator 整合。当我尝试部署时,收到以下消息:

  PHP致命错误:类'Knp \ Bundle \PaginatorBundle \ KnpPaginatorBoundle'未在第16行的AppKernel.php中找到

AppKernel.php 说:

  new Knp \ Bundle\PaginatorBundle\KnpPaginatorBundle() ,

我不知道为什么这个包不被识别,因为在我的PHP编辑器中,我可以看到所有我的供应商文件夹中的包文件( vendor / knplabs /...)。



另一个警告信息可能对于解决这个问题很有帮助:在GIT中,当我在另一个分支并签出 EXAMPLE-123 分支时,我收到消息:


 警告:无法rmdir供应商/ knplabs / knp-components:目录不为空
警告:无法rmdir vendo

Blockquote


r / knplabs / knp-paginator-bundle / Knp / Bundle / PaginatorBundle:


目录不为空


谁能理解这个问题?

解决方案 应该被追踪,即它应该在你的 .gitignore 文件中。相反,应该使用 composer 工具下载软件包并安装它们。



在你的情况下,我会建议到:


  1. 将项目解包到临时目录中,
  2. 运行作曲家安装

  3. 部署临时目录内容。


I use Symfony2 in my project and switched to my branch EXAMPLE-123 in which some days ago. I integrated pagination with KnpPaginator. When I just tried to deploy, I received the following message:

PHP Fatal error: Class 'Knp\Bundle\PaginatorBundle\KnpPaginatorBoundle' not found in AppKernel.php on line 16 

Line 16 of AppKernel.php says:

new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(),

I have no clue why the bundle is not recognized, because in my PHP editor I can see all the bundle files in my vendor folder (vendor/knplabs/...).

Another warning message that might be helpful for solving this problem: When in GIT I am in another branch and checkout to the EXAMPLE-123 branch, I get the message:

warning: unable to rmdir vendor/knplabs/knp-components: Directory not empty
warning: unable to rmdir vendo

Blockquote

r/knplabs/knp-paginator-bundle/Knp/Bundle/PaginatorBundle:

Directory not empty

Who can make sense of this problem? How can I solve it?

解决方案

The files under vendor/ aren't supposed to be tracked, i.e. it's supposed to be in your .gitignore file. Instead, the composer utility should be used to download the packages and install them.

In your case I would suggest to:

  1. Unpack the project into a temporary directory,
  2. Run composer install
  3. Deploy the temporary directory contents.

这篇关于Git:找不到供应商中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆