How to use composer with WampServer?



PHP Snippet 1:

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

PHP Snippet 2:

PHP 7.2.10-0ubuntu0.18.04.1 (cli) (built: Sep 13 2018 13:45:02) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.10-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies

PHP Snippet 3:

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

PHP Snippet 4:

sudo mv composer.phar /user/bin/local/composer

PHP Snippet 5:

require_once "vendor/autoload.php";

PHP Snippet 6:

use Library0/Class0;
use Library1/Class1;
use Library2/Class2;

PHP Snippet 7:

@ECHO OFF
php "%~dp0composer.phar" %*

PHP Snippet 8:

@ECHO OFF
REM php "%~dp0composer.phar" %*
C:\wamp64\bin\php\php5.6.40\php.exe "%~dp0composer.phar" %*