2015-04-24 13:33
浏览 38


Ive downloaded a helper library of an API written in PHP from GITHUB, but when I download the .zip file it doesnt contain vendor folder, but everywhere in the code it is seeking some files from vendor folder-which is error in running.

Can you help me how to get these? new to the system.

图片转代码服务由CSDN问答提供 功能建议

我已经从GITHUB下载了一个用PHP编写的API的帮助库,但是当我下载.zip文件时它没有 包含供应商文件夹,但代码中的任何地方都在寻找供应商文件夹中的某些文件 - 这在运行时出错。

您能帮我解决这些问题吗? ? 新系统。

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongluan1743 2015-04-24 15:04

    If you're working with PHP and you can't find a vendor/ directory that you expect to see, that PHP codebase probably uses Composer:

    Composer is a tool for dependency management in PHP. It allows you to declare the dependent libraries your project needs and it will install them in your project for you.

    One surefire way to know that a project uses Composer (aside from reading its documentation) is to see if there are composer.json and composer.lock files (probably) in the root of the repository. These files define the project's dependencies.

    To generate the vendor/ directory,

    1. install Composer,
      • there are a few ways to do this, and it is OS-dependent, but something like curl -sS | php should work if you're on Linux or OSX,
    2. open a terminal and cd into the project directory,
    3. run composer install,
      • depending on how you installed Composer, you may have to run php composer.phar install instead,
    4. wait for Composer to do its thing.

    Composer will download your dependencies, putting the code into vendor/, and generate an autoloader class that hooks everything together. Depending on what the dependencies are it might also do other things, like linking all CLI binaries to vendor/bin/.

    打赏 评论

相关推荐 更多相似问题