在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。
立即学习“PHP免费学习笔记(深入)”;
throw的Exception里面已经写的很明白了
你开发一个项目通过composer进行包依赖管理, 然后把它开源把到github上, 但是你依赖的第三方库是没必要放到版本控制器中的.
只需要把composer.json文件放上去, read.me文件中一般会说明安装方式, 让你运行 composer install,
所以一般会把vendor忽略掉, git忽略掉vendor的方法是在 .gitignore 增加这个目录.
全网最新最细最实用WPS零基础入门到精通全套教程!带你真正掌握WPS办公! 内含Excel基础操作、函数设计、数据透视表等
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号