zohocrm-php-sdk icon indicating copy to clipboard operation
zohocrm-php-sdk copied to clipboard

Fix when path contains 'src'

Open tom-knight opened this issue 2 years ago • 0 comments
trafficstars

If you run the php-sdk from a path that includes the string "src" it will throw an SDKException as it cannot find the JSON details file.

E.g if my code is running from /home/user/src/project/ (with /home/user/src/project/vendor/zohocrm/php-sdk/) I get the following error when I try to call Initializer::initialize:

com\zoho\crm\api\exception\SDKException Caused by : ERROR IN READING JSONDETAILS FILE : - file_get_contents(/home/user/src/resources/JSONDetails.json): Failed to open stream: No such file or directory

It should be using the file /home/user/src/project/vendor/zohocrm/php-sdk/src/resources/JSONDetails.json.

This PR fixes this issue and works for both paths containing and not containing "src".

tom-knight avatar Mar 31 '23 18:03 tom-knight