gpt4 book ai didi

php - Bitbucket 不保存供应商文件

转载 作者:太空狗 更新时间:2023-10-29 14:47:29 27 4
gpt4 key购买 nike

我已经在我的本地主机中克隆了一个在 VPS 中正常工作的存储库。

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

但是当我尝试清除缓存时:

$ sudo php app/console cache:clear

我收到这个错误:

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

我在 bitbucket.org 上有存储库。这是我在 kriswallsmith 的供应商目录形式的 bitbucket 存储库中看到的:

assetic → 0e18168c45df [0e18168c45df]

为什么看不到里面的文件和文件夹?它也发生在所有供应商目录中。我本地主机中的供应商目录是空的。

我试过:

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

我得到下一个错误:

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]

很明显,因为 vendor/kriswallsmith/assetic 中没有文件夹或文件。

如果我输入:

$ sudo php composer.phar install

我明白了:

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]

最佳答案

错误是提交的供应商目录。特别是如果通过 git 检索供应商,则会执行供应商的整个 git 克隆。然后,如果您提交更改,除了已经从另一个 git 存储库添加的文件外,所有更改都会被添加。

简单:永远不要将供应商提交给 VCS。你有 composer 和提交的 composer.lock 每个人都会得到完全相同的版本。

如果您必须更改 bundle 代码,请 fork 它并 load the code from your fork! .稍后,如果更改总体上影响了 bundle ,请创建对原始请求的 pull 请求;)

关于php - Bitbucket 不保存供应商文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18683035/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com