K
K
k-22016-01-10 21:18:31
PHP
k-2, 2016-01-10 21:18:31

How to install composer and how to use it under windows?

Good day!
I have never used Composer. But I understand that this tool is very necessary.
Searching on Google, I really did not understand anything. It looks like the SEOs have screwed everything up.
The official website is not verbose.
What I have already done:
1. Downloaded and installed the exe file.
2. When installing, I set the path to the hampp file php
3. I watched a video in which it says that you need to install the Composer Asset Plugin and register on Packgist.
- First question , why should I install it? Of course, I can install, but I'm interested in the specific essence of this plugin (what will it do, why is it needed, why do I need this site if I use only github)
4.this article says
Inside your working directory run the command:
composer require silex/silex ~1.1

- Question two . How can I do this? Where should I put it in my directory???
There are no answers to seemingly elementary questions.
Thank you in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
k-2, 2016-01-11
@K-2

I will try to sum up the first results.
Composer can be used in 2 versions.
Globally (by installing the program) and Locally (without installing anything)
Both methods work only from the command line. (Start->Accessories->Command Prompt)
To copy something to the command prompt ctrl+v doesn't work! Use the right mouse button-> paste
now there is a boot file in the directory
4 . Run the command to load the framework (each has its own), in the Command line we write:
php composer.phar require silex / silex ~1.1 (for the silex framework)
In the Command line, commands are run differently for local and global downloads:
Locally: php composer.phar require silex/silex ~1.1
Globally: composer require silex/silex ~1.1
Even when downloading locally, you need to download the installation file every time (this is not difficult and is described in step 3): php -r "readfile(' https://getcomposer.org/installer ');" | php
This file is not needed when loading globally.
GLOBALLY step by step
1. Download the composer program https://getcomposer.org/Composer-Setup.exe
2. Run. When requesting a php file, specify the path to local hosting -> php
3 folder. Now we do everything the same as for local upload, but skip step 3, and change requests from the Command line (instead of php composer.phar we write composer ). Example:
it was like this: php composer.phar require silex/silex ~1.1
it became like this: composer require silex/silex ~1.1
Other differences between global and local downloads haven't been answered yet!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question