简体   繁体   English

如何安装Doctrine 2.2 ORM的下载版本

[英]How to install downloaded version of Doctrine 2.2 ORM

I have downloaded the latest version of Doctrine ORM and on their site it says: "See the configuration section on how to configure and bootstrap a downloaded version of Doctrine." 我已经下载了最新版本的Doctrine ORM,并在其网站上显示:“请参阅配置部分,了解如何配置和引导已下载版本的Doctrine。”

Then i go there ( http://docs.doctrine-project.org/en/latest/reference/configuration.html ) and i find at "class loading" section, that i have to add the following line to my project: 然后我去那里( http://docs.doctrine-project.org/en/latest/reference/configuration.html ),然后在“类加载”部分中发现,我必须在项目中添加以下行:

require_once "vendor/autoload.php";

Where's that autoload.php file? 那个autoload.php文件在哪里? Where's the vendor folder? 供应商文件夹在哪里? I don't get it... Thanks. 我不明白...谢谢。

When you downloaded the 'latest version' it included that autoload file. 当您下载“最新版本”时,它会包含该自动加载文件。 Locate it in the download and change the file path in the require_once function the the path of the file: 在下载中找到它,然后在require_once函数中将文件路径更改为文件路径:

require_once "/location/of/files/you/downloaded/vendor/autoload.php";

As you can see about 400px down on the page here, you need to use to PEAR to install the files first: 正如您在此处的页面上看到的大约400px向下,您需要使用PEAR首先安装文件:

http://www.doctrine-project.org/projects/orm.html http://www.doctrine-project.org/projects/orm.html

You can do it by installing composer first. 您可以通过先安装作曲家来做到这一点。 Follow the guide in this page http://getcomposer.org/doc/00-intro.md . 遵循此页面中的指南http://getcomposer.org/doc/00-intro.md There's a description for Windows and Unix users, this will install composer, then create a json file that looks like this: 有一个针对Windows和Unix用户的描述,它将安装composer,然后创建一个类似于以下内容的json文件:

{
  "require": {
      "doctrine/orm": "2.*",
      "symfony/yaml": "2.*"
  },
  "autoload": {
      "psr-0": {"": "src/"}
  }
}

Then from the cmd/terminal, run this command: composer install 然后从cmd / terminal运行以下命令: composer install

You will find that the vendor folder is created automatically. 您会发现vendor文件夹是自动创建的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM