Paypal核心SDK没有Composer


Paypal core SDK without Composer

我正在尝试让PHP核心SDK在没有composer的情况下工作。似乎没有一种简单的方法可以在没有composer的情况下使用SDK(https://github.com/paypal/sdk-core-php)

有没有可能有人有一个自动加载器脚本或其他解决方案来实现这一点?

我一直在网上搜索其他信息,但似乎我是唯一一个活着的人,试图在没有Composer的情况下让它发挥作用。

有机会吗?谢谢

好吧,看来我真的是这个星球上唯一想这么做的人。好吧,那我自己回答我的问题。这似乎是在没有composer的情况下运行每个composer包的指南。Yihaa''o/。对于大多数使用composer的人来说,这可能是一件简单的事情,但我从未使用过它,因为我在一个糟糕的windows共享主机上。

这是基于debian的,但用YUM代替redhat或其他什么。

所以,我在我的根目录中这样做,不要抱怨:)

Ssh进入你的Linux盒子(本地mac或windows也可以,但我没有告诉你)

# 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.

现在,您可以在包含所有名为lib包(或您想称之为任何花哨名称)的东西的地方创建一个目录,并在项目中添加以下行

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

沃伊拉,你完了。