Commit 60fe84c8 by Carsten Brandt

guide: consistent usage of composer command

parent 0a3769ce
...@@ -31,7 +31,7 @@ With Composer installed, you can install Yii by running the following commands u ...@@ -31,7 +31,7 @@ With Composer installed, you can install Yii by running the following commands u
The first command installs the [composer asset plugin](https://github.com/francoispluchino/composer-asset-plugin/) The first command installs the [composer asset plugin](https://github.com/francoispluchino/composer-asset-plugin/)
which allows managing bower and npm package dependencies through Composer. You only need to run this command which allows managing bower and npm package dependencies through Composer. You only need to run this command
once for all. The second command installs Yii in a directory named `basic`. once for all. The second command installs Yii in a directory named `basic`. You can choose a different directory name if you want.
> Note: During the installation it may happen that Composer asks for login credentials for your Github account because it hits the > Note: During the installation it may happen that Composer asks for login credentials for your Github account because it hits the
> Github API rate-limit. This is normal because Composer needs to retrieve a lot of information for all the packages from Github. > Github API rate-limit. This is normal because Composer needs to retrieve a lot of information for all the packages from Github.
......
...@@ -17,7 +17,7 @@ To use an extension, you need to install it first. Most extensions are distribut ...@@ -17,7 +17,7 @@ To use an extension, you need to install it first. Most extensions are distribut
packages which can be installed by taking the following two simple steps: packages which can be installed by taking the following two simple steps:
1. modify the `composer.json` file of your application and specify which extensions (Composer packages) you want to install. 1. modify the `composer.json` file of your application and specify which extensions (Composer packages) you want to install.
2. run `php composer.phar install` to install the specified extensions. 2. run `composer install` to install the specified extensions.
Note that you may need to install [Composer](https://getcomposer.org/) if you do not have it. Note that you may need to install [Composer](https://getcomposer.org/) if you do not have it.
...@@ -172,7 +172,7 @@ We recommend you prefix `yii2-` to the project name for packages representing Yi ...@@ -172,7 +172,7 @@ We recommend you prefix `yii2-` to the project name for packages representing Yi
It is important that you specify the package type of your extension as `yii2-extension` so that the package can It is important that you specify the package type of your extension as `yii2-extension` so that the package can
be recognized as a Yii extension when being installed. be recognized as a Yii extension when being installed.
When a user runs `php composer.phar install` to install an extension, the file `vendor/yiisoft/extensions.php` When a user runs `composer install` to install an extension, the file `vendor/yiisoft/extensions.php`
will be automatically updated to include the information about the new extension. From this file, Yii applications will be automatically updated to include the information about the new extension. From this file, Yii applications
can know which extensions are installed (the information can be accessed via [[yii\base\Application::extensions]]. can know which extensions are installed (the information can be accessed via [[yii\base\Application::extensions]].
......
...@@ -19,7 +19,7 @@ Gii is an official Yii extension. The preferred way to install this extension is ...@@ -19,7 +19,7 @@ Gii is an official Yii extension. The preferred way to install this extension is
You can either run this command: You can either run this command:
``` ```
php composer.phar require --prefer-dist yiisoft/yii2-gii "*" composer require "yiisoft/yii2-gii:*"
``` ```
Or you can add this code to the require section of your `composer.json` file: Or you can add this code to the require section of your `composer.json` file:
......
...@@ -12,19 +12,18 @@ Installation ...@@ -12,19 +12,18 @@ Installation
### Install via Composer ### Install via Composer
If you do not have [Composer](http://getcomposer.org/), you may download it from If you do not have [Composer](http://getcomposer.org/), follow the instructions in the
[http://getcomposer.org/](http://getcomposer.org/) or run the following command on Linux/Unix/MacOS: [Installing Yii](start-installation.md#installing-via-composer) section to install it.
~~~ With Composer installed, you can then install the application using the following commands:
curl -sS http://getcomposer.org/installer | php
~~~
You can then install the application using the following command: composer global require "fxp/composer-asset-plugin:1.0.0-beta2"
composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-advanced yii-application
~~~ The first command installs the [composer asset plugin](https://github.com/francoispluchino/composer-asset-plugin/)
php composer.phar global require "fxp/composer-asset-plugin:1.0.0-beta2" which allows managing bower and npm package dependencies through Composer. You only need to run this command
php composer.phar create-project --prefer-dist --stability=dev yiisoft/yii2-app-advanced /path/to/yii-application once for all. The second command installs the advanced application in a directory named `yii-application`.
~~~ You can choose a different directory name if you want.
Getting started Getting started
--------------- ---------------
...@@ -204,7 +203,7 @@ your project. ...@@ -204,7 +203,7 @@ your project.
Now the interesting part. You can add more packages your application needs to the `require` section. Now the interesting part. You can add more packages your application needs to the `require` section.
All these packages are coming from [packagist.org](https://packagist.org/) so feel free to browse the website for useful code. All these packages are coming from [packagist.org](https://packagist.org/) so feel free to browse the website for useful code.
After your `composer.json` is changed you can run `php composer.phar update --prefer-dist`, wait till packages are downloaded and After your `composer.json` is changed you can run `composer update --prefer-dist`, wait till packages are downloaded and
installed and then just use them. Autoloading of classes will be handled automatically. installed and then just use them. Autoloading of classes will be handled automatically.
Creating links from backend to frontend Creating links from backend to frontend
......
...@@ -48,6 +48,6 @@ Use the Template ...@@ -48,6 +48,6 @@ Use the Template
That's all that's required to create a new Yii application template. Now you can create projects using your template: That's all that's required to create a new Yii application template. Now you can create projects using your template:
``` ```
php composer.phar global require "fxp/composer-asset-plugin:1.0.0-beta2" composer global require "fxp/composer-asset-plugin:1.0.0-beta2"
php composer.phar create-project --prefer-dist --stability=dev mysoft/yii2-app-coolone new-project composer create-project --prefer-dist --stability=dev mysoft/yii2-app-coolone new-project
``` ```
...@@ -17,7 +17,7 @@ Many third-party libraries are released in terms of [Composer](https://getcompos ...@@ -17,7 +17,7 @@ Many third-party libraries are released in terms of [Composer](https://getcompos
You can install such libraries by taking the following two simple steps: You can install such libraries by taking the following two simple steps:
1. modify the `composer.json` file of your application and specify which Composer packages you want to install. 1. modify the `composer.json` file of your application and specify which Composer packages you want to install.
2. run `php composer.phar install` to install the specified packages. 2. run `composer install` to install the specified packages.
The classes in the installed Composer packages can be autoloaded using the Composer autoloader. Make sure The classes in the installed Composer packages can be autoloaded using the Composer autoloader. Make sure
the [entry script](structure-entry-scripts.md) of your application contains the following lines to install the [entry script](structure-entry-scripts.md) of your application contains the following lines to install
...@@ -83,8 +83,8 @@ If the third-party system uses Composer to manage its dependencies, you can simp ...@@ -83,8 +83,8 @@ If the third-party system uses Composer to manage its dependencies, you can simp
to install Yii: to install Yii:
``` ```
php composer.phar require yiisoft/yii2-framework:* composer require "yiisoft/yii2:*"
php composer.phar install composer install
``` ```
Otherwise, you can [download](http://www.yiiframework.com/download/) the Yii release file and unpack it in Otherwise, you can [download](http://www.yiiframework.com/download/) the Yii release file and unpack it in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment