From 72ddeccc0ae7dd10e4b22d93733af11afcb544c1 Mon Sep 17 00:00:00 2001 From: Jay Patel Date: Wed, 24 Sep 2014 15:03:08 -0500 Subject: [PATCH] Updated version of SDK Core - Updated sample to not use its own composer.json --- sample/README.md | 4 ++-- sample/bootstrap.php | 7 +++++-- sample/composer.json | 14 -------------- 3 files changed, 7 insertions(+), 18 deletions(-) delete mode 100644 sample/composer.json diff --git a/sample/README.md b/sample/README.md index 70e1a9b..bda3407 100644 --- a/sample/README.md +++ b/sample/README.md @@ -1,9 +1,9 @@ Rest API Samples =================== +This sample project is a simple web app that you can explore to understand what the payment APIs can do for you. -This sample project is a simple web app that you can explore to understand what the payment APIs can do for you. To try out the sample, run `composer update --no-dev` from the samples folder and you are all set. - +To try out the sample, run `composer update --no-dev` from the rest-api-sdk-php folder and you are all set. The sample comes pre-configured with a test account but in case you need to try them against your account, you must diff --git a/sample/bootstrap.php b/sample/bootstrap.php index 48ead06..d253e9c 100644 --- a/sample/bootstrap.php +++ b/sample/bootstrap.php @@ -4,12 +4,15 @@ */ // Include the composer autoloader +// The location of your project's vendor autoloader. $composerAutoload = dirname(dirname(dirname(__DIR__))) . '/autoload.php'; if (!file_exists($composerAutoload)) { - $composerAutoload = __DIR__ .'/vendor/autoload.php'; + //If the project is used as its own project, it would use rest-api-sdk-php composer autoloader. + $composerAutoload = dirname(__DIR__) .'/vendor/autoload.php'; - if(!file_exists(__DIR__ .'/vendor/autoload.php')) { + + if(!file_exists($composerAutoload)) { echo "The 'vendor' folder is missing. You must run 'composer update' to resolve application dependencies.\nPlease see the README for more information.\n"; exit(1); } diff --git a/sample/composer.json b/sample/composer.json deleted file mode 100644 index 305f340..0000000 --- a/sample/composer.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "paypal/rest-api-sdk-sample-php", - "description": "Samples using PayPal's REST API SDK for PHP", - "homepage": "https://github.com/paypal/rest-api-sdk-php", - "config": { - "require-all": true - }, - "require": { - "php": ">=5.3.0", - "ext-curl": "*", - "ext-json": "*", - "paypal/rest-api-sdk-php" : "0.11.*" - } -}