在本地用 Satis 搭建 Composer Packages 镜像

这篇文章将教导你怎么在本地搭建一个composer镜像以节约大量的网络开销时间.

What Is Satis?

Sitis是我们将要用来对我们的项目镜像各种仓库的应用程序名字.它就像一个代理坐落在 Internet 和你的 Composer 之间. 我们的解决方案将要创建一个本地的一些包的镜像并且通知我们的 composer 来使用它来替代在 Internet 上寻找 sources.

一张图胜过千言万语.

如果在本地找到了包,那么讲从本地安装,如果没有,那么将默认从 packagist.org 安装.

Getting Satis

Satis 安装非常简单, 直接通过 composer 安装.首先安装 composer.

1
curl -sS https://getcomposer.org/installer | php

然后安装 satis

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
[haidx@mbp:~/repo/test]$ composer  create-project composer/satis --stability=dev --keep-vcs
Installing composer/satis (dev-master ef2a73a9c4250abcde4349d3d468d3cb5286c529)
  - Installing composer/satis (dev-master master)
    Cloning master

Created project in /Users/haidx/repo/test/satis
Loading composer repositories with package information
Installing dependencies from lock file
  - Installing symfony/process (dev-master 0ae3bf5)
    Cloning 0ae3bf5ff90edbe6e30e645221646479c2f1ef54

  - Installing symfony/finder (v2.4.2)
    Downloading: 100%

  - Installing symfony/console (dev-master afee085)
    Cloning afee08520a971c0f073bff89e1d456405e244c37

  - Installing seld/jsonlint (1.1.2)
    Downloading: 100%

  - Installing justinrainbow/json-schema (1.1.0)
    Downloading: 100%

  - Installing composer/composer (dev-master 0d4c2bb)
    Cloning 0d4c2bb7d7a864a9b3e876908e743310cdeaa5e6

  - Installing twig/twig (v1.15.1)
    Loading from cache

symfony/console suggests installing symfony/event-dispatcher ()
Generating autoload files

//todo 未完待续

参考文献

Comments