作曲家和Yii [英] Composer and Yii

查看:129
本文介绍了作曲家和Yii的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用作曲家作为我的依赖关系管理器,因为我需要使用Yii Framework开发我将它添加到我的composer.json文件中,所以它看起来像这样:

I'm using composer as my dependency manager and since I need to develop with Yii Framework I added it to my composer.json file, so it looks like this:

//other properties...
"require": {
    //other dependencies...
    "yiisoft/yii": "dev-master"
}

Composer.json可以,Yii正确下载,但是我认为作曲家错过的功能。
我的yii目录现在充满了垃圾,演示文件夹,构建文件bla bla,我真的不需要。
有一种方法来告诉作曲家只保留一些目录并丢弃其他目录。

Composer.json is ok, Yii downloaded correctly, but there is a feature I think composer misses. My yii directory now is full of "rubbish", demo folders, build files bla bla that I don't really need. There is a way to tell composer to keep only some directory and throw away the others?

推荐答案

与作曲家我们以不同的方式工作。与作曲家我们的应用程序只关心其代码。其实,如果你用git kork,你必须添加yii文件夹.gitignore couse不是你的应用程序文件夹。这是symfony的方式。

With composer we work in a different way. With composer our application take care only of its code. In fact, if you kork with git, you must add yii folder to .gitignore couse is not your application folder. This is the symfony way.

Yii呢?首先,我建议你启动yii项目:

What about Yii!? First of all I suggest you to start yii projects with:

$ composer create-project yiisoft/yii path/to/your/project

这是与Yii和作曲家合作的Yii方式。之后,当你完成下载yii时,作曲者问你是否要保留yii的git文件。你可以简单地说no,并手动删除这些文件。你也可以尝试分叉yiisoft / yii并改善这种行为,这样删除的东西就会自动发生。

This is the Yii way to work with yii and composer. After that, when you finish to dowload yii, composer ask you if you want to keep or not yii's git files. You can simply say no, and remove manually these files. You can also try to fork yiisoft/yii and improve this behavior so this removing stuffs will happen automatically.

这篇关于作曲家和Yii的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆