Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paypal core SDK without Composer

Tags:

php

sdk

paypal

I'm trying to get the PHP Core SDK to work without composer. There doesn't seem to be a simple way of working with the SDK without composer (https://github.com/paypal/sdk-core-php)

Any chance someone has an autoloader script or another solution to get this working?

I've been scanning for other information throughout the web, but it seems i'm the only person alive trying to get this to work without Composer.

Any chance? Thanks!

like image 825
Benjamin de Bos Avatar asked Oct 22 '14 23:10

Benjamin de Bos


1 Answers

Alright, so it seems that i am really the only person on this planet who wants to do this. Well, then i'll answer my question myself. It seems like this is the guide for running every composer package without composer. Yihaa \o/. Probably easy stuff for most people using composer, but i've never used it because i'm on a shitty windows shared-host.

This is based on debian, but replace every apt-get with YUM for redhat or whatever.

So, i'm doing this in my root directory, don't whine about it :)

Ssh into your Linux Box (local mac or windows will work aswell but i'm not telling you)

# cd into the root directory (or user directory)
cd ~/

# install php5 and php5-curl and unzip (because the package we're 
# getting is from GitHub). There might be other stuff your package is asking for. 
# So just include it at the end
apt-get install php-5 php5-curl unzip

# install composer
curl -sS https://getcomposer.org/installer | php

# get the master archive
wget https://github.com/paypal/sdk-core-php/archive/master.zip

# unzip it
unzip master.zip

# cd into the directory
cd master

# move the files back to the ~/ directory
mv * ..

# remove the master directory
rm -r master

# install package using composer
php composer.phar install

# now we have the lib directory and the vendor directory. Lets tar that up
tar -cf package.tar lib/ vendor/

#we now have a tar file called package.tar copy that to your computer, ftp, whatever.

You can now create a directory in the place where you include all your stuff called lib-package (or whatever fancy name you'd like to call it) and add the following line in your project

require_once(/path/to/your/package/lib-package/vendor/autoload.php)

Voila, you're done.

like image 124
Benjamin de Bos Avatar answered Nov 15 '22 07:11

Benjamin de Bos