简体   繁体   中英

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."

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:

require_once "vendor/autoload.php";

Where's that autoload.php file? 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 "/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:

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 . There's a description for Windows and Unix users, this will install composer, then create a json file that looks like this:

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

Then from the cmd/terminal, run this command: composer install

You will find that the vendor folder is created automatically.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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