sApiKey = API_KEY; } else { $oUser->iId = API_USERNAME; $oUser->sPassword = API_PASSWORD; $oUser->sType = API_USER_TYPE; $oUser->sApiKey = API_KEY; } // get PHP ver $iPhpVer= str_replace('.', '', phpversion()); // PHP5 (only 5.0.5 onwards has __setSoapHeaders) if (class_exists('SoapClient') && $iPhpVer>505) { // use PHP5 ext require_once('class.php5Client.php'); $oClient =& Php5Client::getInstance($oUser); } // Check soap is installed. If not, dispaly error message // elseif ($iPhpVer>505) { die('You are missing the PHP SoapClient. Please re-compile PHP with Soap enabled.'); } // no SOAP client could be initialized else { die('AffiliateWindow APIs will only work with PHP5 and above. Please reinstall'); } return $oClient; } } // end class