git - I have PHP code I need to use—how do I install it? -


i'm trying code set use particular company's api.

i have experience perl , if need module installed, type cpan modulename , of time works. how work php code of similar complexity?

the company in question have github repository php client system access api, looks same perl module.

i can git clone it, can download it, what? have install it? there no installation instructions. or start using it? there's composer.json file in there. need run composer command can figure out , install dependencies cpan module would? install system folders or right there in whatever directory happens in? feel there ought kind of official installation process because there's /tests/ folder in files downloaded.

their example code literally starts this:

<?php      /* @var $companyname \companyname_api */     $companyname = new \companyname_api();     /* interesting stuff */ 

and that's it. of course nothing works if because doesn't know companyname_api files are. works if add this:

<?php     include('/full/path/to/downloaded/files/companyname/src/api.php'); 

is need do?

in order install dependencies defined in composer.json run following command inside project directory:

composer install 

this find , download dependencies vendor directory , generate optimized autoloader.

to autoload own source files you'll need add autoload section in composer.json file:


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -