沃梦达 / 编程问答 / php问题 / 正文

在作曲家 laravel 上安装依赖项(doctrine/dbal)

Install dependency (doctrine/dbal) on composer laravel(在作曲家 laravel 上安装依赖项(doctrine/dbal))

本文介绍了在作曲家 laravel 上安装依赖项(doctrine/dbal)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试执行迁移以重命名某些列,但出现异常.

I am trying to execute a migration to rename some columns and I got an exception.

当我阅读文档时,我必须将教义/dbal 依赖项添加到我的 composer.json 文件中.我怎么做?哪个是正确的 composer.json 文件.我的申请中有很多.是与文件夹 app、bootstrap、public 和 vendor 处于同一级别的那个.

As I read on the documentation I have to add the doctrine/dbal dependency to my composer.json file. How do I do that? Which is the correct composer.json file. I have many in my application. Is the one that is on the same level as the folders app,bootstrap, public and vendor.

如果是这样,我该如何添加该依赖项.我需要下载什么吗?

If so how do I add that dependency. Do I have to download anything?

顺便说一句,我使用的是easyphp,而不是wamp!

By the way im using easyphp, not wamp!

执行此操作后,控制台会抛出此错误

After doing that the console throws this error

推荐答案

要添加此依赖项,请打开项目根目录下的 composer.json(与 app、public 等处于同一级别)并在 require 部分添加像这样的学说/dbal 包:

To add this dependency open the composer.json at the root of your project (in the same level as app, public etc.) and in the require section add the doctrine/dbal package like:

"require": {
    "laravel/framework": "4.1.*",
    "doctrine/dbal": "v2.4.2"
},

保存文件并运行 composer update

编辑

您可能使用默认设置安装了 git,但它不在您的 PATH 环境中.

You probably installed git with the default settings and it's not in your PATH env.

打开 Git Bash(它与 git 一起安装 - 你会在你的程序中找到它)并执行 composer update.顺便说一句,windows 命令提示符要好得多.

Open Git Bash (it was installed with git - you will find it in your programs) and do composer update. By the way it's far better that windows command prompt.

这篇关于在作曲家 laravel 上安装依赖项(doctrine/dbal)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:在作曲家 laravel 上安装依赖项(doctrine/dbal)

基础教程推荐