A
A
Alexey2020-10-19 12:34:11
Apache HTTP Server
Alexey, 2020-10-19 12:34:11

How to properly import an extension through Composer?

Hello!

Recently started working with Composer. I want to import an extension (eg Twig) for a project, I enter a command, but it gives an error..

e:\programmer\php\tutorials\composer\vkdeepmine-master>php composer.phar require
 twig/twig:~1.8
Could not open input file: composer.phar


If you run from the folder of Composer itself, then ok, but it imports not in the project itself, but in the program folder

C:\ProgramData\ComposerSetup\bin>php composer.phar require twig/twig:~1.8
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
  - Installing symfony/polyfill-ctype (v1.18.1): Downloading (100%)
  - Installing twig/twig (v1.43.1): Downloading (100%)
Writing lock file
Generating autoload files


1) How can I make this command work in the project folder?
2) If not, can I simply copy the downloaded packages to the project folder?

Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey, 2016-03-21
@DenisDangerous

If the client has a problem with the SSL certificate, then he will not see your redirect (when it works), because he will not be able to establish a connection with the server.

Z
zorca, 2020-10-19
@Allexio

Installing Composer globally and running is simple: composer require ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question