為什麼PHPWord的原始碼中沒有vendor的檔案夾?

來源:互聯網
上載者:User
在PHPWord/bootstrap.php
中:

$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'        )    );}

但在這裡:https://github.com/PHPOffice/...
並沒有看到vendor的檔案夾?
這是怎麼回事?

回複內容:

在PHPWord/bootstrap.php
中:

$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'        )    );}

但在這裡:https://github.com/PHPOffice/...
並沒有看到vendor的檔案夾?
這是怎麼回事?

composer install一下應該就會產生。
沒用使用composer包管理就沒有vendor。

throw的Exception裡面已經寫的很明白了

你開發一個項目通過composer進行包依賴管理, 然後把它開源把到github上, 但是你依賴的第三方庫是沒必要放到版本控制器中的.
只需要把composer.json檔案放上去, read.me檔案中一般會說明安裝方式, 讓你運行 composer install,
所以一般會把vendor忽略掉, git忽略掉vendor的方法是在 .gitignore 增加這個目錄.

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.