From 9e7cb951a6d79bf1208b870a6cfc47aeca2d8c40 Mon Sep 17 00:00:00 2001 From: japatel Date: Mon, 22 Dec 2014 14:13:08 -0600 Subject: [PATCH] Authorization Cache to use both boolean and string in configuration - both true and 'true' will enable authorization cache --- lib/PayPal/Cache/AuthorizationCache.php | 2 +- sample/bootstrap.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/PayPal/Cache/AuthorizationCache.php b/lib/PayPal/Cache/AuthorizationCache.php index 1da0d0f..0204770 100644 --- a/lib/PayPal/Cache/AuthorizationCache.php +++ b/lib/PayPal/Cache/AuthorizationCache.php @@ -85,7 +85,7 @@ abstract class AuthorizationCache $config = ($config && is_array($config)) ? $config : PayPalConfigManager::getInstance()->getConfigHashmap(); if (array_key_exists("cache.enabled", $config)) { $value = $config['cache.enabled']; - return (trim($value) == 'true') ? true : false; + return (trim($value) == true || trim($value) == 'true') ? true : false; } return false; } diff --git a/sample/bootstrap.php b/sample/bootstrap.php index 00f7fac..ad6509b 100644 --- a/sample/bootstrap.php +++ b/sample/bootstrap.php @@ -77,7 +77,7 @@ function getApiContext($clientId, $clientSecret) 'log.FileName' => '../PayPal.log', 'log.LogLevel' => 'FINE', 'validation.level' => 'log', - 'cache.enabled' => 'true', + 'cache.enabled' => true, // 'http.headers.PayPal-Partner-Attribution-Id' => '123123123' ) );