From 514d56769f1797d57a88434b13af1f6907ec7739 Mon Sep 17 00:00:00 2001 From: Mark Ogilvie Date: Tue, 25 Feb 2020 14:49:51 +0000 Subject: [PATCH 1/9] Add a handler constant --- src/oauth/utility/ZohoOAuthConstants.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/oauth/utility/ZohoOAuthConstants.php b/src/oauth/utility/ZohoOAuthConstants.php index 0523b737..80d817e9 100644 --- a/src/oauth/utility/ZohoOAuthConstants.php +++ b/src/oauth/utility/ZohoOAuthConstants.php @@ -52,6 +52,8 @@ class ZohoOAuthConstants const EXPIRIY_TIME = "expiry_time"; + const PERSISTENCE_HANDLER = "persistence_handler"; + const PERSISTENCE_HANDLER_CLASS = "persistence_handler_class"; const PERSISTENCE_HANDLER_CLASS_NAME = "persistence_handler_class_name"; @@ -86,4 +88,4 @@ class ZohoOAuthConstants const RESPONSECODE_OK = 200; -} \ No newline at end of file +} From 3b6815e287d212b8feaf9d86e3592f4cda662eaf Mon Sep 17 00:00:00 2001 From: Mark Ogilvie Date: Tue, 25 Feb 2020 14:55:19 +0000 Subject: [PATCH 2/9] Inject persistance handler via config. --- src/oauth/ZohoOAuth.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/oauth/ZohoOAuth.php b/src/oauth/ZohoOAuth.php index 2d69dc99..e5eb96ef 100644 --- a/src/oauth/ZohoOAuth.php +++ b/src/oauth/ZohoOAuth.php @@ -48,6 +48,7 @@ private static function setConfigValues($configuration) ZohoOAuthConstants::CLIENT_SECRET, ZohoOAuthConstants::REDIRECT_URL, ZohoOAuthConstants::ACCESS_TYPE, + ZohoOAuthConstants::PERSISTENCE_HANDLER, ZohoOAuthConstants::PERSISTENCE_HANDLER_CLASS, ZohoOAuthConstants::IAM_URL, ZohoOAuthConstants::TOKEN_PERSISTENCE_PATH, @@ -140,6 +141,9 @@ public static function getPersistenceHandlerInstance() if(ZohoOAuth::getConfigValue("token_persistence_path")!=""){ return new ZohoOAuthPersistenceByFile() ; } + else if(self::$configProperties[ZohoOAuthConstants::PERSISTENCE_HANDLER] instanceof ZohoOAuthPersistenceInterface){ + return self::$configProperties[ZohoOAuthConstants::PERSISTENCE_HANDLER]; + } else if(self::$configProperties[ZohoOAuthConstants::PERSISTENCE_HANDLER_CLASS] == "ZohoOAuthPersistenceHandler"){ return new ZohoOAuthPersistenceHandler(); } @@ -161,4 +165,4 @@ public static function getClientInstance() } return ZohoOAuthClient::getInstanceWithOutParam(); } -} \ No newline at end of file +} From cc4fa8afca5ce3ae99860e5208aeeb16d46cbc10 Mon Sep 17 00:00:00 2001 From: Mark Ogilvie Date: Tue, 25 Feb 2020 15:00:32 +0000 Subject: [PATCH 3/9] Inject custom persistence handler via config. --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1e11fc96..823ae0b2 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,7 @@ apiBaseUrl apiVersion access_type accounts_url +persistence_handler persistence_handler_class token_persistence_path db_port @@ -111,7 +112,9 @@ applicationLogFilePath - The SDK stores the log information in a file. The file path of the folder must be specified in the key and the SDK automatically creates the file. The default file name is the ZCRMClientLibrary.log. In case the path isn't specified, the log file will be created inside the project. -persistence_handler_class is the implementation of the ZohoOAuthPersistenceInterface. +persistence_handler_class is the implementation of the ZohoOAuthPersistenceInterface. This will instantiate a class based on the file location. eg \home\php\CustomPersistence.php + +persistence_handler - You can inject an instantiated persistence hander into the configuration during run time to pass yourcustom persistence handler to the XohoOAuth class. >If the Optional keys are not specified, their default values will be assigned automatically. >The 'apiBaseUrl' and 'accounts_url' are mandatory in case the user is not in the "com" domain. From fe9c17e8d57ef8d356a9d59fd3ccdaab697c67d9 Mon Sep 17 00:00:00 2001 From: Mark Ogilvie Date: Tue, 25 Feb 2020 16:42:38 +0000 Subject: [PATCH 4/9] Add class for interface --- src/oauth/ZohoOAuth.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/oauth/ZohoOAuth.php b/src/oauth/ZohoOAuth.php index e5eb96ef..c5085903 100644 --- a/src/oauth/ZohoOAuth.php +++ b/src/oauth/ZohoOAuth.php @@ -5,6 +5,7 @@ use zcrmsdk\oauth\exception\ZohoOAuthException; use zcrmsdk\oauth\persistence\ZohoOAuthPersistenceByFile; use zcrmsdk\oauth\persistence\ZohoOAuthPersistenceHandler; +use zcrmsdk\oauth\persistence\ZohoOAuthPersistenceInterface; use zcrmsdk\oauth\utility\ZohoOAuthConstants; use zcrmsdk\oauth\utility\ZohoOAuthParams; From 2e02c19476a0dd1c49515fc1c2dc3a5e49e706ab Mon Sep 17 00:00:00 2001 From: Mark Ogilvie Date: Sat, 24 Oct 2020 23:55:40 +0100 Subject: [PATCH 5/9] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 823ae0b2..96c915dd 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ ---------------------- PHP SDK for Zoho CRM APIs provides wrapper for Zoho CRM APIs. Hence invoking a Zoho CRM API from your client application is just a method call.It supports both single user as well as multi user authentication. +Currently using this bundle for payments at (https://www.parolla.ie)](https://www.parolla.ie) and (https://tools.parolla.ie)](https://tools.parolla.ie) + Registering a Zoho Client ------------------------- Since Zoho CRM APIs are authenticated with OAuth2 standards, you should register your client app with Zoho. To register your app: From 85ffe43a3a33ce765582ca5498c40d4683878c3b Mon Sep 17 00:00:00 2001 From: Mark Ogilvie Date: Tue, 1 Dec 2020 12:13:52 +0000 Subject: [PATCH 6/9] Update README.md Remove self references --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 96c915dd..823ae0b2 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ ---------------------- PHP SDK for Zoho CRM APIs provides wrapper for Zoho CRM APIs. Hence invoking a Zoho CRM API from your client application is just a method call.It supports both single user as well as multi user authentication. -Currently using this bundle for payments at (https://www.parolla.ie)](https://www.parolla.ie) and (https://tools.parolla.ie)](https://tools.parolla.ie) - Registering a Zoho Client ------------------------- Since Zoho CRM APIs are authenticated with OAuth2 standards, you should register your client app with Zoho. To register your app: From 97d9de63b8e9cbc97c1fbb93f46c994454d20de8 Mon Sep 17 00:00:00 2001 From: Mark Ogilvie Date: Thu, 3 Mar 2022 10:22:10 +0000 Subject: [PATCH 7/9] Update ZCRMException.php --- src/crm/exception/ZCRMException.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/crm/exception/ZCRMException.php b/src/crm/exception/ZCRMException.php index 2f420db1..75c3f5e3 100644 --- a/src/crm/exception/ZCRMException.php +++ b/src/crm/exception/ZCRMException.php @@ -11,13 +11,7 @@ class ZCRMException extends \Exception // Unknown protected $code = 0; - - // User-defined exception code - protected $file; - - // Source filename of exception - protected $line; - + // Source line of exception private $trace; @@ -77,4 +71,4 @@ public function setExceptionDetails($exceptionDetails) { $this->exceptionDetails = $exceptionDetails; } -} \ No newline at end of file +} From 4d4a970959caaef11448ff28f315cf7b3494b892 Mon Sep 17 00:00:00 2001 From: Mark Ogilvie Date: Thu, 3 Mar 2022 10:45:05 +0000 Subject: [PATCH 8/9] Update composer.json --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index a72fdf22..b86080f4 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ }, "autoload" : { "psr-4" : { - "zcrmsdk\\" : "src/" + "zcrmsdk\\" : "src" } } -} \ No newline at end of file +} From fd527c3d7b5558e97b25cdee569f7e5afbb8fd8e Mon Sep 17 00:00:00 2001 From: Mark Ogilvie Date: Thu, 3 Mar 2022 10:46:49 +0000 Subject: [PATCH 9/9] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b86080f4..293b5d2a 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ }, "autoload" : { "psr-4" : { - "zcrmsdk\\" : "src" + "zcrmsdk\\" : "src/" } } }