简体   繁体   中英

PHP/Git - Which files to include / link in my own file?

I have shared hosting to try and test my PHP projects. I'm still learning to code so excuse my silly questions. From various tutorials online I learnt that I don't need to install git to use code from GitHub. I learned that I can download the code from GitHub and host the files directly to my hosting.

Given that I'm not using Composer/Git to get the source due to restrictions on my host and PC (admin restrictions). How will I know which file to use to link to in my own files eg require ('library/PayPal-PHP-SDK-master/filename.php'); say in my index.php

When I tried to use PayPal's SDK and I tried to run one of their sample codes I was given this error The 'vendor' folder is missing. You must run 'composer update' to resolve application dependencies. Please see the README for more information.; The 'vendor' folder is missing. You must run 'composer update' to resolve application dependencies. Please see the README for more information.;

Obviously, since I can't use composer, I can't resolve the above. How can I go around it, please?

If you do not want to use composer, you can grab the SDK zip that contains Paypal PHP Rest API SDK with all its dependencies with it.

Instructions

Download latest/desired release zip file starting with PayPal-PHP-SDK-*.zip from Releases Section https://github.com/paypal/PayPal-PHP-SDK/releases

Go to your project directory. If you do not have one, just create a directory and cd in.

mkdir project cd project Unzip, and copy directory to your project location This is how your directory structure would look like

在此处输入图片说明

then you could use the autoload.php with a require :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM