2017-11-16 13 views
2

프로젝트에서 내 composer install 프로세스를 최적화하려고합니다. Prestissimo를 설치했고, 내 dev 종속성을 'require-dev'로 옮겼으며, composer.json 파일에서 'preferred-install'을 'dist'로 설정했습니다. 이 모든 것이 설치를 ~ 4 분에서 ~ 2 분으로 줄였습니다.Composer에서 캐시에서 '로드'및 캐시에서 일부 '복제'를 수행하는 이유

내 의존성에는 Gitlab에있는 내 자신의 개인 저장소가 포함되어 있습니다. 설치 프로그램이 내 프로세스를 볼 때 '캐시에서 복제'라고 말하면서 몇 초씩 처리해야합니다. 다른 모든 종속성은 ' 캐시에서 로딩 '및 프로세스가 거의 즉시 처리됩니다.

여기

ghost$ composer install 
Loading composer repositories with package information 
Installing dependencies (including require-dev) from lock file 
Package operations: 45 installs, 0 updates, 0 removals 
    - Installing yiisoft/yii2-composer (2.0.5): Loading from cache 
    - Installing bower-asset/jquery (3.2.1): Loading from cache 
    - Installing bower-asset/bootstrap (v3.3.7): Loading from cache 
    - Installing bower-asset/inputmask (3.3.10): Loading from cache 
    - Installing bower-asset/punycode (v1.3.2): Loading from cache 
    - Installing bower-asset/yii2-pjax (2.0.7.1): Loading from cache 
    - Installing cebe/markdown (1.1.2): Loading from cache 
    - Installing ezyang/htmlpurifier (v4.9.3): Loading from cache 
    - Installing psr/log (1.0.2): Loading from cache 
    - Installing monolog/monolog (1.23.0): Loading from cache 
    - Installing paragonie/random_compat (v2.0.11): Loading from cache 
    - Installing phenx/php-font-lib (0.4): Loading from cache 
    - Installing phenx/php-svg-lib (0.1): Loading from cache 
    - Installing phpoffice/phpexcel (1.8.1): Loading from cache 
    - Installing yiisoft/yii2 (2.0.13.1): Loading from cache 
    - Installing bower-asset/jquery-ui (1.11.4): Loading from cache 
    - Installing yiisoft/yii2-jui (2.0.6): Loading from cache 
    - Installing yiisoft/yii2-bootstrap (2.0.7): Loading from cache 
    - Installing yiisoft/yii2-httpclient (2.0.5): Loading from cache 
    - Installing yiisoft/yii2-authclient (2.1.4): Loading from cache 
    - Installing toruinteractive/ti-tree (0.13.1): Cloning 867ff3625c from cache 
    - Installing toruinteractive/ti-translator (0.13.1): Cloning eec41060e4 from cache 
    - Installing toruinteractive/ti-superadmin (0.13.1): Cloning a783cd0bb9 from cache 
    - Installing toruinteractive/ti-suggest (0.13.1): Cloning b52895d1ab from cache 
    - Installing toruinteractive/ti-slides (0.13.1): Cloning e0a5f9738f from cache 
    - Installing toruinteractive/ti-search (0.13.1): Cloning a2e1f8ac89 from cache 
    - Installing toruinteractive/ti-page (0.13.1): Cloning 9b3653a648 from cache 
    - Installing toruinteractive/ti-navbar (0.13.1): Cloning 711fe81e0a from cache 
    - Installing toruinteractive/ti-login (0.13.1): Cloning e7f64c010b from cache 
    - Installing imagine/imagine (v0.6.3): Loading from cache 
    - Installing flowjs/flow-php-server (v1.0.3): Loading from cache 
    - Installing toruinteractive/ti-image (0.13.1): Cloning 5089e00de0 from cache 
    - Installing toruinteractive/ti-file (0.13.1): Cloning 68ec65c025 from cache 
    - Installing arogachev/yii2-excel (0.1.1): Loading from cache 
    - Installing toruinteractive/ti-export-import (0.13.1): Cloning cd8309c01d from cache 
    - Installing toruinteractive/ti-dashboard (0.13.1): Cloning ccb9d159e4 from cache 
    - Installing toruinteractive/ti-blog (0.13.1): Cloning e0d3296d01 from cache 
    - Installing toruinteractive/ti-banner (0.13.1): Cloning cadf895998 from cache 
    - Installing sentry/sentry (0.17.0): Loading from cache 
    - Installing ramsey/uuid (3.7.1): Loading from cache 
    - Installing mandrill/mandrill (1.0.55): Loading from cache 
    - Installing fightbulc/moment (1.26.10): Loading from cache 
    - Installing dompdf/dompdf (v0.7.0): Loading from cache 
    - Installing toruinteractive/ti-cms (0.13.1): Cloning 6fd9d9fe53 from cache 
    - Installing yiisoft/yii2-debug (dev-master b2cd366): Loading from cache 
Generating autoload files 

그래서 제 질문은 내가 속도를 캐시에서 내 자신의 패키지 '로드'를 만들 수있는 방법입니다 ... composer.json

{ 
    "name": "my-project", 
    "description": "My Project", 
    "minimum-stability": "stable", 
    "require": { 
     "toruinteractive/ti-cms": "0.13.1" 
    }, 
    "require-dev" : { 
     "yiisoft/yii2-debug": "^[email protected]" 
    }, 
    "config": { 
     "fxp-asset": { 
      "installer-paths": { 
      "npm-asset-library": "vendor/npm", 
      "bower-asset-library": "vendor/bower" 
      } 
     }, 
     "process-timeout": 1800, 
     "preferred-install" : "dist" 
    }, 
    "extra": { 
     "require-bower" : { 
      "angular-elastic" : "2.5.*", 
      "angular-trix" : "1.0.2", 
      "aos":"2.1.1", 
      "handlebars" : "4.0.*", 
      "bootstrap-toggle" : "^2.2.2", 
      "image-map-resizer" : "1.0.*" 
     } 
    }, 
    "repositories": [ 
     { "type": "git", "url" : "[email protected]:ti-cms/ti-banner.git" }, 
     { "type": "git", "url" : "[email protected]:ti-cms/ti-blog.git" }, 
     { "type": "git", "url" : "[email protected]:ti-cms/ti-suggest.git" }, 
     { "type": "git", "url": "[email protected]:ti-cms/ti-cms.git" }, 
     { "type": "git", "url": "[email protected]:ti-cms/ti-dashboard.git" }, 
     { "type": "git", "url": "[email protected]:ti-cms/ti-file.git" }, 
     { "type": "git", "url": "[email protected]:ti-cms/ti-image.git" }, 
     { "type": "git", "url": "[email protected]:ti-cms/ti-export-import.git" }, 
     { "type": "git", "url": "[email protected]:ti-cms/ti-login.git" }, 
     { "type": "git", "url": "[email protected]:ti-cms/ti-navbar.git" }, 
     { "type": "git", "url": "[email protected]:ti-cms/ti-page.git" }, 
     { "type": "git", "url": "[email protected]:ti-cms/ti-search.git" }, 
     { "type": "git", "url": "[email protected]:ti-cms/ti-slides.git" }, 
     { "type": "git", "url": "[email protected]:ti-cms/ti-superadmin.git" }, 
     { "type": "git", "url": "[email protected]:ti-cms/ti-translator.git" }, 
     { "type": "git", "url": "[email protected]:ti-cms/ti-tree.git" } 
    ] 
} 

그리고 여기에 composer install 출력입니다 내 설치 과정?

답변

1

저는 이것이 git repos와 준비된 패키지의 차이점이라고 생각합니다. 즉, git repo와 dist (zip/tar) 파일을 복제하는 것입니다. 캐시 된 zip 파일은 압축을 풀면 완료됩니다.

git repo의 경우 복제 작업이 조금 더 시간이 걸리므로 네트워크를 통해 캐시 된 Repo가 최신 상태인지 확인한 다음 작업 디렉토리 복제본에 실제 캐시 된 Repo를 수행 할 가능성이 높습니다.

자신의 패키지를 캐시에서로드하려면 dist (zip/tar) 형식으로 배포하십시오.