Skip to content

Commit dc45de1

Browse files
committed
Added --prefer-dist to all docs
1. It results in much smaller download and takes less disk space (25MB instead of 180MB for yii-basic + dependencies). 2. It requires less utilities to be installed (no VCS binaries required). 3. It takes less time to install dependencies.
1 parent c56647f commit dc45de1

File tree

27 files changed

+31
-30
lines changed

27 files changed

+31
-30
lines changed

apps/advanced/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ at [getcomposer.org](http://getcomposer.org/doc/00-intro.md#installation-nix).
7070
You can then install the application using the following command:
7171

7272
~~~
73-
php composer.phar create-project --stability=dev yiisoft/yii2-app-advanced advanced
73+
php composer.phar create-project --prefer-dist --stability=dev yiisoft/yii2-app-advanced advanced
7474
~~~
7575

7676

apps/basic/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ at [getcomposer.org](http://getcomposer.org/doc/00-intro.md#installation-nix).
5252
You can then install this application template using the following command:
5353

5454
~~~
55-
php composer.phar create-project --stability=dev yiisoft/yii2-app-basic basic
55+
php composer.phar create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic basic
5656
~~~
5757

5858
Now you should be able to access the application through the following URL, assuming `basic` is the directory

apps/benchmark/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ curl -s http://getcomposer.org/installer | php
4343
You can then install the Bootstrap Application using the following command:
4444

4545
~~~
46-
php composer.phar create-project --stability=dev yiisoft/yii2-app-benchmark yii-benchmark
46+
php composer.phar create-project --prefer-dist --stability=dev yiisoft/yii2-app-benchmark yii-benchmark
4747
~~~
4848

4949
Now you should be able to access the benchmark page using the URL

docs/guide/apps-advanced.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ curl -s http://getcomposer.org/installer | php
2020
You can then install the application using the following command:
2121

2222
~~~
23-
php composer.phar create-project --stability=dev yiisoft/yii2-app-advanced /path/to/yii-application
23+
php composer.phar create-project --prefer-dist --stability=dev yiisoft/yii2-app-advanced /path/to/yii-application
2424
~~~
2525

2626
Getting started
@@ -171,5 +171,5 @@ your project.
171171
Now the interesting part. You can add more packages your application needs to `require` section.
172172
All these packages are coming from [packagist.org](https://packagist.org/) so feel free to browse the website for useful code.
173173

174-
After your `composer.json` is changed you can run `php composer.phar update`, wait till packages are downloaded and
174+
After your `composer.json` is changed you can run `php composer.phar update --prefer-dist`, wait till packages are downloaded and
175175
installed and then just use them. Autoloading of classes will be handled automatically.

docs/guide/apps-basic.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ curl -s http://getcomposer.org/installer | php
2020
You can then install the Bootstrap Application using the following command:
2121

2222
~~~
23-
php composer.phar create-project --stability=dev yiisoft/yii2-app-basic /path/to/yii-application
23+
php composer.phar create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic /path/to/yii-application
2424
~~~
2525

2626
Now set document root directory of your Web server to /path/to/yii-application/web and you should be able to access the application using the URL `http://localhost/`.
@@ -159,5 +159,5 @@ your project.
159159
Now the interesting part. You can add more packages your application needs to `require` section.
160160
All these packages are coming from [packagist.org](https://packagist.org/) so feel free to browse the website for useful code.
161161

162-
After your `composer.json` is changed you can run `php composer.phar update`, wait till packages are downloaded and
162+
After your `composer.json` is changed you can run `php composer.phar update --prefer-dist`, wait till packages are downloaded and
163163
installed and then just use them. Autoloading of classes will be handled automatically.

docs/guide/composer.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Once you have edited the `composer.json`, you can invoke Composer to install the
4444
For the first installation of the dependencies, use this command:
4545

4646
```
47-
php composer.phar install
47+
php composer.phar install --prefer-dist
4848
```
4949

5050
This must be executed within your Yii project's directory, where the `composer.json` file can be found.
@@ -54,7 +54,7 @@ to the `composer.phar` script.
5454
For an existing installation, you can have Composer update the dependencies using:
5555

5656
```
57-
php composer.phar update
57+
php composer.phar update --prefer-dist
5858
```
5959

6060
Again, you may need to provide specific path references.

docs/guide/gii.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Gii comes as an offical extension and the preferred way to install this extensio
1414
Either run
1515

1616
```
17-
php composer.phar require yiisoft/yii2-gii "*"
17+
php composer.phar require --prefer-dist yiisoft/yii2-gii "*"
1818
```
1919

2020
or add

docs/guide/template.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ your `composer.json` to include
3838
"yiisoft/yii2-twig": "*",
3939
```
4040

41-
in `require` section and then run `composer update`.
41+
in `require` section and then run `composer update --preder-dist`.
4242

4343
Twig
4444
----

docs/guide/view.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ adding the following to `require`:
9393
"ezyang/htmlpurifier": "v4.6.0"
9494
```
9595

96-
After it's done run `php composer.phar install` and wait till package is downloaded. Now everything is prepared to use
96+
After it's done run `php composer.phar install --prefer-dist` and wait till package is downloaded. Now everything is prepared to use
9797
Yii's HtmlPurifier helper:
9898

9999
```php

docs/internals/getting-started.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ Composer package. Here's how to do it:
77
1. `git clone [email protected]:yiisoft/yii2-app-basic.git`.
88
2. Remove `.git` directory from cloned directory.
99
3. Change `composer.json`. Instead of all stable requirements add just one `"yiisoft/yii2-dev": "*"`.
10-
4. Execute `composer create-project`.
10+
4. Execute `composer create-project`. Do not add `--prefer-dist` to the command since it will not download git repository
11+
then.
1112
5. Now you have working playground that uses latest code.
1213

1314
Note that requirements of extensions that come with `yii2-dev` are not loaded automatically.

extensions/yii/apidoc/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The preferred way to install this extension is through [composer](http://getcomp
1111
Either run
1212

1313
```
14-
php composer.phar require yiisoft/yii2-apidoc "*"
14+
php composer.phar require --prefer-dist yiisoft/yii2-apidoc "*"
1515
```
1616

1717
or add

extensions/yii/authclient/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The preferred way to install this extension is through [composer](http://getcomp
1212
Either run
1313

1414
```
15-
php composer.phar require yiisoft/yii2-authclient "*"
15+
php composer.phar require --prefer-dist yiisoft/yii2-authclient "*"
1616
```
1717

1818
or add

extensions/yii/bootstrap/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The preferred way to install this extension is through [composer](http://getcomp
1919
Either run
2020

2121
```
22-
php composer.phar require yiisoft/yii2-bootstrap "*"
22+
php composer.phar require --prefer-dist yiisoft/yii2-bootstrap "*"
2323
```
2424

2525
or add

extensions/yii/codeception/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The preferred way to install this extension is through [composer](http://getcomp
1717
Either run
1818

1919
```
20-
php composer.phar require yiisoft/yii2-codeception "*"
20+
php composer.phar require --prefer-dist yiisoft/yii2-codeception "*"
2121
```
2222

2323
or add

extensions/yii/debug/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The preferred way to install this extension is through [composer](http://getcomp
1414
Either run
1515

1616
```
17-
php composer.phar require yiisoft/yii2-debug "*"
17+
php composer.phar require --prefer-dist yiisoft/yii2-debug "*"
1818
```
1919

2020
or add

extensions/yii/elasticsearch/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The preferred way to install this extension is through [composer](http://getcomp
3131
Either run
3232

3333
```
34-
php composer.phar require yiisoft/yii2-elasticsearch "*"
34+
php composer.phar require --prefer-dist yiisoft/yii2-elasticsearch "*"
3535
```
3636

3737
or add

extensions/yii/faker/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The preferred way to install this extension is through [composer](http://getcomp
1212
Either run
1313

1414
```
15-
php composer.phar require yiisoft/yii2-faker "*"
15+
php composer.phar require --prefer-dist yiisoft/yii2-faker "*"
1616
```
1717

1818
or add

extensions/yii/gii/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The preferred way to install this extension is through [composer](http://getcomp
1313
Either run
1414

1515
```
16-
php composer.phar require yiisoft/yii2-gii "*"
16+
php composer.phar require --prefer-dist yiisoft/yii2-gii "*"
1717
```
1818

1919
or add

extensions/yii/imagine/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The preferred way to install this extension is through [composer](http://getcomp
1212
Either run
1313

1414
```
15-
php composer.phar require yiisoft/yii2-imagine "*"
15+
php composer.phar require --prefer-dist yiisoft/yii2-imagine "*"
1616
```
1717

1818
or add

extensions/yii/jui/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The preferred way to install this extension is through [composer](http://getcomp
2828
Either run
2929

3030
```
31-
php composer.phar require yiisoft/yii2-jui "*"
31+
php composer.phar require --prefer-dist yiisoft/yii2-jui "*"
3232
```
3333

3434
or add

extensions/yii/mongodb/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The preferred way to install this extension is through [composer](http://getcomp
1414
Either run
1515

1616
```
17-
php composer.phar require yiisoft/yii2-mongodb "*"
17+
php composer.phar require --prefer-dist yiisoft/yii2-mongodb "*"
1818
```
1919

2020
or add

extensions/yii/redis/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The preferred way to install this extension is through [composer](http://getcomp
2929
Either run
3030

3131
```
32-
php composer.phar require yiisoft/yii2-redis "*"
32+
php composer.phar require --prefer-dist yiisoft/yii2-redis "*"
3333
```
3434

3535
or add

extensions/yii/smarty/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The preferred way to install this extension is through [composer](http://getcomp
2929
Either run
3030

3131
```
32-
php composer.phar require yiisoft/yii2-smarty "*"
32+
php composer.phar require --prefer-dist yiisoft/yii2-smarty "*"
3333
```
3434

3535
or add

extensions/yii/sphinx/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The preferred way to install this extension is through [composer](http://getcomp
1212
Either run
1313

1414
```
15-
php composer.phar require yiisoft/yii2-sphinx "*"
15+
php composer.phar require --prefer-dist yiisoft/yii2-sphinx "*"
1616
```
1717

1818
or add

extensions/yii/swiftmailer/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The preferred way to install this extension is through [composer](http://getcomp
3737
Either run
3838

3939
```
40-
php composer.phar require yiisoft/yii2-swiftmailer "*"
40+
php composer.phar require --prefer-dist yiisoft/yii2-swiftmailer "*"
4141
```
4242

4343
or add

extensions/yii/twig/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The preferred way to install this extension is through [composer](http://getcomp
3232
Either run
3333

3434
```
35-
php composer.phar require yiisoft/yii2-twig "*"
35+
php composer.phar require --prefer-dist yiisoft/yii2-twig "*"
3636
```
3737

3838
or add

framework/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The preferred way to install this extension is through [composer](http://getcomp
1212
Either run
1313

1414
```
15-
php composer.phar require "yiisoft/yii2 *"
15+
php composer.phar require --prefer-dist "yiisoft/yii2 *"
1616
```
1717

1818
or add

0 commit comments

Comments
 (0)