SimpleSAML_Auth_State::parseStateID PHP Метод

parseStateID() публичный статический Метод

Get the ID and (optionally) a URL embedded in a StateID, in the form 'id:url'.
Автор: Andreas Solberg, UNINETT AS ([email protected])
Автор: Jaime Perez, UNINETT AS ([email protected])
public static parseStateID ( string $stateId ) : array
$stateId string The state ID to use.
Результат array A hashed array with the ID and the URL (if any), in the 'id' and 'url' keys, respectively. If there's no URL in the input parameter, NULL will be returned as the value for the 'url' key.
    public static function parseStateID($stateId)
    {
        $tmp = explode(':', $stateId, 2);
        $id = $tmp[0];
        $url = null;
        if (count($tmp) === 2) {
            $url = $tmp[1];
        }
        return array('id' => $id, 'url' => $url);
    }

Usage Example

Пример #1
0
 /**
  * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML_Auth_State::parseStateID() instead.
  */
 public static function parseStateID($stateId)
 {
     return SimpleSAML_Auth_State::parseStateID($stateId);
 }