Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sugar_initialize(){
- # get variable settings that are entered using the form defined in the file sugarcrm_bridge.admin.inc
- $url = variable_get('sugar_test_url', '');
- $username = variable_get('sugar_username', '');
- $password = variable_get('sugar_password', '');
- # we default to the test URL, but if the environment is prod, then sugar prod is selected
- if(isset($_SERVER['SGK_ENVIRONMENT']) && $_SERVER['SGK_ENVIRONMENT'] == 'prod'){
- $url = variable_get('sugar_url', '');
- }
- #include the Spinegar wrapper class
- require_once libraries_get_path('sugarcrm7-api-wrapper-class') . '/vendor/autoload.php';
- $sugar = new \Spinegar\Sugar7Wrapper\Rest();
- $sugar->setUrl($url)
- ->setUsername($username)
- ->setPassword($password)
- ->connect();
- return $sugar;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement