donglun7151 2013-09-08 11:16
浏览 63
已采纳

Bitbucket不保存供应商文件

I've cloned a repository in my localhost that is working right in a VPS.

$ sudo git clone https://msalsas@bitbucket.org/msalsas/itransformer-2.0.git

But when I try to clear cache with:

$ sudo php app/console cache:clear

I get this error:

PHP Warning:  require(/home/manolo/MiServer/itransformer-2.0/vendor/kriswallsmith/assetic/src/functions.php): failed to open stream: No such file or directory in /home/manolo/MiServer/itransformer-2.0/vendor/composer/autoload_real.php on line 42
PHP Fatal error:  require(): Failed opening required '/home/manolo/MiServer/itransformer-2.0/vendor/kriswallsmith/assetic/src/functions.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/manolo/MiServer/itransformer-2.0/vendor/composer/autoload_real.php on line 42

I have the repository at bitbucket.org. This is what I can see at kriswallsmith's vendor directory form bitbucket repository:

assetic → 0e18168c45df [0e18168c45df]

Why cannot see the files and folders inside? It also happens in all vendor directories. And vendor directories in my localhost are empty.

I've tried to do:

$ sudo php composer.phar self-update
$ sudo php composer.phar update kriswallsmith/assetic

and I get the next error:

Loading composer repositories with package information
Updating dependencies (including require-dev)                             
 - Removing twig/twig (v1.13.1)
 - Installing twig/twig (v1.13.2)
Loading from cache

 - Updating kriswallsmith/assetic 1.1.x-dev (0e18168 => 1d671c5)



[RuntimeException]                                                           
The .git directory is missing from /home/manolo/MiServer/itransformer-2.0/v  
endor/kriswallsmith/assetic, see http://getcomposer.org/commit-deps for mor  
e information                                                              



update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [packages1] ... [packagesN]

Obvious, because there are no folders or files inside vendor/kriswallsmith/assetic.

If I type:

$ sudo php composer.phar install

I get this:

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
- Removing twig/twig (v1.13.2)
- Installing twig/twig (v1.13.1)
Downloading: 100%         

Generating autoload files
PHP Warning:  require(/home/manolo/MiServer/itransformer-2.0/vendor/kriswallsmith/assetic/src/functions.php): failed to open stream: No such file or directory in /home/manolo/MiServer/itransformer-2.0/vendor/composer/autoload_real.php on line 43
PHP Fatal error:  require(): Failed opening required '/home/manolo/MiServer/itransformer-2.0/vendor/kriswallsmith/assetic/src/functions.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/manolo/MiServer/itransformer-2.0/vendor/composer/autoload_real.php on line 43
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap handling the post-install-cmd event terminated with an exception



[RuntimeException]                                     
An error occurred when generating the bootstrap file.  



install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader]
  • 写回答

2条回答 默认 最新

  • douhuan1937 2013-12-28 20:56
    关注

    The fault was the committed vendor directory. Especcially if a vendor is retrieved via git a whole git clone of the vendor is performed. Then if you commit your changes, all get added except already added files from another git repo.

    Simple: Never commit vendor to a VCS. You have composer and with a committed composer.lock everyone will get exactly the same version.

    And if you have to change a bundles code, fork it and load the code from your fork!. And later if the change affects the bundle in general, create a pull request to the original ;)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥30 STM32 INMP441无法读取数据
  • ¥100 求汇川机器人IRCB300控制器和示教器同版本升级固件文件升级包
  • ¥15 用visualstudio2022创建vue项目后无法启动
  • ¥15 x趋于0时tanx-sinx极限可以拆开算吗
  • ¥500 把面具戴到人脸上,请大家贡献智慧
  • ¥15 任意一个散点图自己下载其js脚本文件并做成独立的案例页面,不要作在线的,要离线状态。
  • ¥15 各位 帮我看看如何写代码,打出来的图形要和如下图呈现的一样,急
  • ¥30 c#打开word开启修订并实时显示批注
  • ¥15 如何解决ldsc的这条报错/index error
  • ¥15 VS2022+WDK驱动开发环境