为什么PHPWord的源代码中没有vendor的文件夹?
Aug 18, 2016 am 09:15 AM
在PHPWord/bootstrap.php
中:
<code>$vendorDirPath = realpath(__DIR__ . '/vendor'); if (file_exists($vendorDirPath . '/autoload.php')) { require $vendorDirPath . '/autoload.php'; } else { throw new Exception( sprintf( 'Could not find file \'%s\'. It is generated by Composer. Use \'install --prefer-source\' or \'update --prefer-source\' Composer commands to move forward.', $vendorDirPath . '/autoload.php' ) ); } </code>
但在这里:https://github.com/PHPOffice/...
并没有看到vendor的文件夹?
这是怎么回事?
回复内容:
在PHPWord/bootstrap.php
中:
<code>$vendorDirPath = realpath(__DIR__ . '/vendor'); if (file_exists($vendorDirPath . '/autoload.php')) { require $vendorDirPath . '/autoload.php'; } else { throw new Exception( sprintf( 'Could not find file \'%s\'. It is generated by Composer. Use \'install --prefer-source\' or \'update --prefer-source\' Composer commands to move forward.', $vendorDirPath . '/autoload.php' ) ); } </code>
但在这里:https://github.com/PHPOffice/...
并没有看到vendor的文件夹?
这是怎么回事?
composer install一下应该就会生成。
没用使用composer包管理就没有vendor。
throw的Exception里面已经写的很明白了
你开发一个项目通过composer进行包依赖管理, 然后把它开源把到github上, 但是你依赖的第三方库是没必要放到版本控制器中的.
只需要把composer.json
文件放上去, read.me
文件中一般会说明安装方式, 让你运行 composer install
,
所以一般会把vendor
忽略掉, git忽略掉vendor
的方法是在 .gitignore
增加这个目录.

Article chaud

Outils chauds Tags

Article chaud

Tags d'article chaud

Bloc-notes++7.3.1
Éditeur de code facile à utiliser et gratuit

SublimeText3 version chinoise
Version chinoise, très simple à utiliser

Envoyer Studio 13.0.1
Puissant environnement de développement intégré PHP

Dreamweaver CS6
Outils de développement Web visuel

SublimeText3 version Mac
Logiciel d'édition de code au niveau de Dieu (SublimeText3)

Sujets chauds

Guide d'installation et de mise à niveau de PHP 8.4 pour Ubuntu et Debian

Comment configurer Visual Studio Code (VS Code) pour le développement PHP
