zohocrm-php-sdk
zohocrm-php-sdk copied to clipboard
Fix when path contains 'src'
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".