I am getting an undefined variable error on $instance, $username, $password when trying to use the class in snclient.php: ServiceNowClient. I tried making changing private to public as the function is puiblic but this gave an error too. It seems to me (adn from searching) that the private variables are not passing to the function? How do I solve this?
require_once("SNClient/SNClient.php");
$SNClient = new ServiceNowClient($instance, $username, $password);
snclient.php:
class ServiceNowClient
{
/* Variables */
private $instance = "xx";
private $username = "xx";
private $password = "xx";
private $proxy = "";
/* Constructor of the class
* Required to get credentials to use authentification on Service-Now.
* Example: $SNClient = new ServiceNowClient();
*/
public function __construct($instance, $username, $password){
$this->instance = $instance;
$this->username = $username;
$this->password = $password;
}
Thanks!