SDK 1.x has been written to make upgrading as easy as possible. There are several changes you'll have to make to your website code in order to make it work with SDK 1.x.
Initalization
In IPB SDK 0.5 you use the following code to initalize IPB SDK.
IPB SDK 1.x requires you to use the following code to "initalize" or make avaliable the SDK functions.
require_once "ipbsdk_class.inc.php";
$SDK =& new IPBSDK();
Prefixing calls with $SDK->
In IPB SDK 0.5 all the SDK functions were in the global namespace. In IPB SDK 1.x they are now in one IPBSDK class, making the script less likely to conflict with your website code. As IPB SDK's functions are now in it's own class, you need to add $SDK-> before each call to an SDK function. For example the following IPB SDK 0.5 code:
echo 'you are logged in';
}
will change to:
echo 'you are logged in';
}
If you are using the SDK inside your very own functions you may have to use $GLOBALS['SDK']-> or global $SDK; at the start of the function.
Optional Changes
There are several other changes to your SDK code you should make, but are not required in order to make your script work.
- We recommend using sdk_error, sdk_version, sdk_info and sdk_date instead of ipbsdk_error, ipbsdk_version, ipbsdk_info and ipbsdk_date. Although either will work, the latter is not recommended.
Upgrading Problems
If you have any problems with upgrading your scripts to IPB SDK 1.x, please feel free to ask at our Support and Feedback Forum.