作曲家和 Yii [英] Composer and Yii

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

问题描述

我使用 composer 作为我的依赖管理器,因为我需要使用 Yii 框架进行开发,所以我将它添加到我的 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 下载正确,但我认为 Composer 遗漏了一个功能.我的 yii 目录现在充满了我并不真正需要的垃圾"、演示文件夹、构建文件等等.有没有办法告诉作曲家只保留一些目录并丢弃其他目录?

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?

推荐答案

我遇到了完全相同的问题,所以我结束了 重新打包 Yii 使其只包含框架文件夹.它减少了大约 10Mb 的包.这是 github 存储库链接.

I had the exact same issue, so I ended up repackaging Yii so that it only contains the framework folder. It reduces the package by ~10Mb. Here's a link to the github repo.

只需将以下内容添加到您的 composer.json 文件中即可.

Just add the following to your composer.json file.

{
    "require": {
        "square1-io/yii-framework": "1.1.14"
    }
}

然后运行:

$ composer install

我写了一篇关于它的博文:http://blog.square1.io/post/60830077608/yii-1-1-14-via-composer

I've thrown up a blog post about it: http://blog.square1.io/post/60830077608/yii-1-1-14-via-composer

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

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