Yii2项目规模超过400mb

时间:2017-08-25 05:22:51

标签: php web yii yii2 composer-php

我正在研究yii2框架。我使用作曲家安装了两个扩展程序。

  1. https://github.com/kartik-v/yii2-widget-fileinput
  2. https://github.com/perminder-klair/yii2-dropzone
  3. 几天后,我意识到我的项目规模超过400mb!这很正常吗?我的应用程序的性能会因此而降低吗?

    我使用require来安装扩展程序。

    composer require "kartik-v/yii2-widget-fileinput:@dev"
    

    由于这些扩展,我觉得尺寸正在增加。

    composer.json

    {
    "name": "yiisoft/yii2-app-basic",
    "description": "Yii 2 Basic Project Template",
    "keywords": ["yii2", "framework", "basic", "project template"],
    "homepage": "http://www.yiiframework.com/",
    "type": "project",
    "license": "BSD-3-Clause",
    "support": {
        "issues": "https://github.com/yiisoft/yii2/issues?state=open",
        "forum": "http://www.yiiframework.com/forum/",
        "wiki": "http://www.yiiframework.com/wiki/",
        "irc": "irc://irc.freenode.net/yii",
        "source": "https://github.com/yiisoft/yii2"
    },
    "minimum-stability": "stable",
    "require": {
        "php": ">=5.4.0",
        "yiisoft/yii2": "~2.0.5",
        "yiisoft/yii2-bootstrap": "~2.0.0",
        "yiisoft/yii2-swiftmailer": "~2.0.0",
        "yiister/yii2-gentelella": "~1.0",
        "perminder-klair/yii2-dropzone": "dev-master",
        "kartik-v/yii2-widget-fileinput": "@dev"
    },
    "require-dev": {
        "yiisoft/yii2-debug": "~2.0.0",
        "yiisoft/yii2-gii": "~2.0.0",
        "yiisoft/yii2-faker": "~2.0.0",
    
        "codeception/base": "^2.2.3",
        "codeception/verify": "~0.3.1",
        "codeception/specify": "~0.4.3"
    },
    "config": {
        "process-timeout": 1800,
        "fxp-asset":{
            "installer-paths": {
                "npm-asset-library": "vendor/npm",
                "bower-asset-library": "vendor/bower"
            }
        }
    },
    "scripts": {
        "post-create-project-cmd": [
            "yii\\composer\\Installer::postCreateProject"
        ]
    },
    "extra": {
        "yii\\composer\\Installer::postCreateProject": {
            "setPermission": [
                {
                    "runtime": "0777",
                    "web/assets": "0777",
                    "yii": "0755"
                }
            ],
            "generateCookieValidationKey": [
                "config/web.php"
            ]
        }
    }
    

    }

3 个答案:

答案 0 :(得分:0)

请使用yii2框架检查此文件路径并删除其中的内容:

project_path / frontend / web / assets /

project_path /后端/网络/资产/ 并删除那些内容,他们是视图的兑现版本 也许这会帮助您在将文件上传到服务器之前减少项目的大小(如果你想要的话)

答案 1 :(得分:0)

{project}/backend/runtime
{project}/backend/web/assets
{project}/frontend/runtime
{project}/backend/web/assets

您可以从约文件夹中删除临时文件

答案 2 :(得分:0)

也许您在上传中上传了更多大文件,请检查uploads目录中是否不包含大上传文件,您可以将文件输入限制设置为最大5mb。