/** * Get an instance of the singleton. * * @param string $username User name of the currently logged in user * @param enum $userType Type of user, as set in defines * @return SOAP - Instance of the SOAP class. */ public static function getInstance($username, $userType) { if (!isset($username) || is_null($username)) { throw new InvalidArgumentException('Missing Username.'); } if (!isset($userType) || is_null($userType)) { throw new InvalidArgumentException('Missing user type.'); } if (empty(self::$instance)) { if (SOAP_INFO_TEST_FLAG) { PHPWS_Core::initModClass('hms', SOAP_OVERRIDE_FILE); self::$instance = new TestSOAP($username, $userType); } else { PHPWS_Core::initModClass('hms', 'PhpSOAP.php'); self::$instance = new PhpSOAP($username, $userType); } } return self::$instance; }