# Composer

# Méthode 1 Installation

Command-line installation :
```
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '906a84df04cea2aa72f40b5f787e49f22d4c2f19492ac310e8cba5b96ac8b64115ac402c8cd292b8a03482574915d1a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
```

Binary PATH :
```
sudo mv composer.phar /usr/local/bin/composer
```

### Notable Installer Options

--install-dir

```
You can install composer to a specific directory by using the --install-dir option and providing a target directory. Example:
php composer-setup.php --install-dir=bin
```

--filename
```
You can specify the filename (default: composer.phar) using the --filename option. Example:

php composer-setup.php --filename=composer
```

--version
```
You can install composer to a specific release by using the --version option and providing a target release. Example:

php composer-setup.php --version=1.0.0-alpha8
```

# Méthode 2 Installation

Install Composer In Your Project
Run this in your command line:
```
curl -sS https://getcomposer.org/installer | php
```

Install Dependencies
```
php composer.phar install
```
Autoload Dependencies
```
require 'vendor/autoload.php';
```