Answer the question
In order to leave comments, you need to log in
Please explain about Composer, how to work with it?
Hello!
Found the code on hithub
0. downloaded (insta desktop)
1. installed php (C:/composer)
2. installed composer (C:/php)
3. registered in cmd - composer require mgp25/instagram-php
everything was installed. What to do next is not clear
The instruction contains this:
require __DIR__.'/../vendor/autoload.php';
$ig = new \InstagramAPI\Instagram();
where to prescribe it - did not understand.
Please tell me how to work with this?
Answer the question
In order to leave comments, you need to log in
The composer works simply: it aggregates all files with all classes and includes them into 1 file, which you must include for yourself. Further, all classes, methods, variables, etc. from installed libraries become available to you in your script after you include autoload.php .
autoload.php - this is the file where the composer connects the rest of the scripts. It lies in the vendor folder next to the installed composer.
So write:
require_one __DIR__.'/vendor/autoload.php';
$ig = new \InstagramAPI\Instagram(); //переменной можно пользоваться
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question