Skip to content
This repository has been archived by the owner on Nov 18, 2024. It is now read-only.

Commit

Permalink
Made Composer to be flexible in versioning
Browse files Browse the repository at this point in the history
 - Updated Version number
 - Updated README file
  • Loading branch information
japatel committed Nov 11, 2014
1 parent 2a84fe5 commit 9d6d928
Show file tree
Hide file tree
Showing 6 changed files with 522 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
build
.DS_Store
*.log
.idea

# IDE
.project
Expand Down
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,39 @@

# PayPal PHP Permissions SDK

## POODLE Update
- Because of the Poodle vulnerability, PayPal has disabled SSLv3.
- To enable TLS encryption, the changes were made to [PPHttpConfig.php](https://github.com/paypal/sdk-core-php/blob/namespace-5.3/lib/PayPal/Core/PPHttpConfig.php#L11) in [SDK Core](https://github.com/paypal/sdk-core-php/tree/namespace-5.3) to use a cipher list specific to TLS encryption.
``` php
/**
* Some default options for curl
* These are typically overridden by PPConnectionManager
*/
public static $DEFAULT_CURL_OPTS = array(
CURLOPT_SSLVERSION => 1,
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_TIMEOUT => 60, // maximum number of seconds to allow cURL functions to execute
CURLOPT_USERAGENT => 'PayPal-PHP-SDK',
CURLOPT_HTTPHEADER => array(),
CURLOPT_SSL_VERIFYHOST => 2,
CURLOPT_SSL_VERIFYPEER => 1,
CURLOPT_SSL_CIPHER_LIST => 'TLSv1',
);
```
- There are two primary changes done to curl options:
- CURLOPT_SSLVERSION is set to 1 . See [here](http://curl.haxx.se/libcurl/c/CURLOPT_SSLVERSION.html) for more information
- CURLOPT_SSL_CIPHER_LIST was set to TLSv1, See [here](http://curl.haxx.se/libcurl/c/CURLOPT_SSL_CIPHER_LIST.html) for more information

All these changes are included in the recent release, along with many other bug fixes. We highly encourage you to update your versions, by either using `composer` or running this command shown below:

```
curl -k -L https://raw.githubusercontent.com/paypal/permissions-sdk-php/stable-php5.3/samples/install.php | php
OR
wget https://raw.githubusercontent.com/paypal/permissions-sdk-php/stable-php5.3/samples/install.php
php install.php
```


## Prerequisites

Expand All @@ -27,7 +60,7 @@ To use the SDK,
{
"name": "me/shopping-cart-app",
"require": {
"paypal/permissions-sdk-php":"v3.6.106"
"paypal/permissions-sdk-php":"v3.*"
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion lib/PayPal/Service/PermissionsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class PermissionsService extends PPBaseService {
protected static $SDK_NAME = "permissions-php-sdk";

// SDK Version
protected static $SDK_VERSION = "3.6.106";
protected static $SDK_VERSION = "3.6.107";

/**
* @param $config - Dynamic config map. This takes the higher precedence if config file is also present.
Expand Down
34 changes: 16 additions & 18 deletions samples/PPBootStrap.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
<?php
/**
* Include this file in your application. This file sets up the required classloader based on
* whether you used composer or the custom installer.
*/

* whether you used composer or the custom installer.
*/
//
require_once 'Configuration.php';

// Include the composer autoloader
// The location of your project's vendor autoloader.
$composerAutoload = dirname(dirname(dirname(__DIR__))) . '/autoload.php';
if (!file_exists($composerAutoload)) {
//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($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);
}
}
require $composerAutoload;
/*
* @constant PP_CONFIG_PATH required if credentoal and configuration is to be used from a file
* Let the SDK know where the sdk_config.ini file resides.
*/
//define('PP_CONFIG_PATH', dirname(__FILE__));
/*
* use autoloader
*/
if(file_exists( dirname(__FILE__). '/vendor/autoload.php')) {
require 'vendor/autoload.php';
} else {
require 'PPAutoloader.php';
PPAutoloader::register();
}
18 changes: 18 additions & 0 deletions samples/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "paypal/permissions-sdk-php-sample",
"description": "PayPal permissions SDK for PHP",
"keywords": ["paypal", "php", "sdk"],
"homepage": "https://developer.paypal.com",
"license": "Apache2",
"authors": [
{
"name": "PayPal",
"homepage": "https://github.com/paypal/permissions-sdk-php/contributors"
}
],
"require": {
"php": ">=5.3.0",
"ext-curl": "*",
"paypal/permissions-sdk-php":"3.8.*"
}
}
Loading

0 comments on commit 9d6d928

Please sign in to comment.