/** * The constructor for the main class. * * @param String $host The ePages host to connect. * @param String $shop The refered ePages shop. * @param String $authToken The authentificaton token to connect via REST. * @param boolean $isssl True, if you use SSL, false if not. Default value is true. */ public static function connect($host, $shop, $authToken, $isssl) { if (!InputValidator::isHost($host) || !InputValidator::isShop($shop) || !InputValidator::isAuthToken($authToken)) { self::$ISCONNECTED = false; return; } self::$HOST = $host; self::$SHOP = $shop; self::$ISSSL = $isssl; self::$AUTHTOKEN = $authToken; self::$ISCONNECTED = true; }
/** * Disconnects and deletes all configuration data. * * @author David Pauli <*****@*****.**> * @since 0.0.0 * @since 0.1.2 Add error reporting. * @since 0.2.1 Reset headers and cookies too. */ public static function disconnect() { self::errorReset(); self::$HOST = ""; self::$SHOP = ""; self::$AUTHTOKEN = null; self::$ISCONNECTED = false; self::$ISSSL = true; self::$COOKIES = array(); self::$HEADERS = array(); return true; }
/** * Disconnects and deletes all configuration data. * * @author David Pauli <*****@*****.**> * @since 0.0.0 * @api */ public static function disconnect() { self::$HOST = ""; self::$SHOP = ""; self::$AUTHTOKEN = null; self::$ISCONNECTED = false; self::$ISSSL = true; return true; }