Home > Backend Development > PHP Tutorial > Why is there no vendor folder in the source code of PHPWord?

Why is there no vendor folder in the source code of PHPWord?

WBOY
Release: 2016-08-18 09:15:57
Original
2224 people have browsed it

In 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>
Copy after login
Copy after login

But here: https://github.com/PHPOffice/...
Don’t see the vendor folder?
What’s going on?

Reply content:

In 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>
Copy after login
Copy after login

But here: https://github.com/PHPOffice/...
Don’t see the vendor folder?
What’s going on?

composer install should generate it.
If you don’t use composer package management, there will be no vendor.

Throw’s Exception has been written very clearly

You develop a project through composer for package dependency management, and then open source it and put it on github, but there is no need to put the third-party libraries you rely on in the version controller.
You only need to put the composer.json file Go up, the read.me file will usually explain the installation method, and let you run composer install,
so vendor will usually be ignored. The way to ignore vendor in git is to add this in .gitignore Directory.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template