2017-08-25 56 views
0

我正在研究yii2框架。我已經使用作曲家安裝了兩個擴展。Yii2項目大小超過400mb

  1. https://github.com/kartik-v/yii2-widget-fileinput
  2. https://github.com/perminder-klair/yii2-dropzone

幾天以後,我意識到,我的項目的大小比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" 
     ] 
    } 
} 

}

+0

你能分享你的composer.json文件嗎? –

+0

那麼,你是否通過這個擴展來上傳和保存文件? – Yupik

+0

@Yupik不,我沒有。 –

回答

0

請,如果你使用yii2框架檢查該文件路徑和刪除內容有:

project_path /前端/網絡/資產/

project_path/backend/web/assets/ 並刪除那裏的內容它們是視圖的兌換版本 也許這個wi如果你想上傳文件到服務器,你會幫助你減少項目的大小