src/API.php
private function detectMode($method_name, $response, $parameter = '', $optional = '', $extra = '')
    {
        if ($response[0] === 401 && $this->connect->detect_mode) {
            $this->connect->detect_mode = false;
            $this->connect->setMode(false);
            if (!empty($extra)) {
                return $this->{$method_name}($parameter, $optional, $extra);
            } elseif (!empty($optional)) {
                return $this->{$method_name}($parameter, $optional);
            } elseif (!empty($parameter)) {
                return $this->{$method_name}($parameter);
            } else {
                return $this->{$method_name}();
            }
        }
        return false;
    }
private function detectMode($method_name, $response, $parameter = '', $optional = '', $extra = '')
    {
        if ($response[0] === 401 && $this->connect->detect_mode) {
            $this->connect->detect_mode = false;
            $this->connect->setMode(false);
            if (!empty($extra)) {
                return $this->{$method_name}($parameter, $optional, $extra);
            } elseif (!empty($optional)) {
                return $this->{$method_name}($parameter, $optional);
            } elseif (!empty($parameter)) {
                return $this->{$method_name}($parameter);
            } else {
                return $this->{$method_name}();
            }
        }
        return false;
    }
private function detectMode ( $ method_name , $ response , $ parameter = '' , $ optional = '' , $ extra = '' ) { if ( $ response [ 0 ] === 401 && $ this -> connect -> detect_mode ) { $ this -> connect -> detect_mode = false ; $ this -> connect -> setMode ( false ) ; if ( ! empty ( $ extra ) ) { return $ this -> { $ method_name } ( $ parameter , $ optional , $ extra ) ; } elseif ( ! empty ( $ optional ) ) { return $ this -> { $ method_name } ( $ parameter , $ optional ) ; } elseif ( ! empty ( $ parameter ) ) { return $ this -> { $ method_name } ( $ parameter ) ; } else { return $ this -> { $ method_name } ( ) ; } } return false ; }
This method is to change the URL to staging if failed to authenticate with production.
It will recall the method that has executed previously to perform it in staging.
This method is to change the URL to staging if failed to authenticate with production . It will recall the method that has executed previously to perform it in staging .