Revision: 1974 Author: olavmrk Date: Fri Nov 6 01:02:25 2009 Log: SAMLParser: Remove unused functions.
The getEndpoints() and getDefaultEndpoint() functions are unused after switching to returning all endpoints in the metadata. http://code.google.com/p/simplesamlphp/source/detail?r=1974 Modified: /trunk/lib/SimpleSAML/Metadata/SAMLParser.php ======================================= --- /trunk/lib/SimpleSAML/Metadata/SAMLParser.php Thu Nov 5 03:46:04 2009 +++ /trunk/lib/SimpleSAML/Metadata/SAMLParser.php Fri Nov 6 01:02:25 2009 @@ -1206,66 +1206,6 @@ return $r; } - - - /** - * This function attempts to locate all endpoints which supports one of the given bindings. - * - */ - private function getEndpoints($endpoints, $acceptedBindings = NULL) { - - assert('$acceptedBindings === NULL || is_array($acceptedBindings)'); - - /* Filter the list of endpoints if $acceptedBindings !== NULL. */ - if($acceptedBindings === NULL) return $endpoints; - - $newEndpoints = array(); - foreach($endpoints as $ep) { - /* Add it to the list of valid ACSs if it has one of the supported bindings. */ - if(in_array($ep['Binding'], $acceptedBindings, TRUE)) { - $newEndpoints[] = $ep; - } - } - return $newEndpoints; - } - - - /** - * This function attempts to locate the default endpoint which supports one of the given bindings. - * - * @param $endpoints Array with endpoints in the format returned by parseGenericEndpoint. - * @param $acceptedBindings Array with the accepted bindings. If this is NULL, then we accept any binding. - * @return The default endpoint which supports one of the bindings, or NULL if no endpoints supports - * one of the bindings. - */ - private function getDefaultEndpoint($endpoints, $acceptedBindings = NULL) { - - $endpoints = $this->getEndpoints($endpoints, $acceptedBindings); - - /* First we look for the endpoint with isDefault set to true. */ - foreach($endpoints as $ep) { - - if(array_key_exists('isDefault', $ep) && $ep['isDefault'] === TRUE) { - return $ep; - } - } - - /* Then we look for the first endpoint without isDefault set to FALSE. */ - foreach($endpoints as $ep) { - - if(!array_key_exists('isDefault', $ep)) { - return $ep; - } - } - - /* Then we take the first endpoint we find. */ - if(count($endpoints) > 0) { - return $endpoints[0]; - } - - /* If we reach this point, then we don't have any endpoints with the correct binding. */ - return NULL; - } /** --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "simpleSAMLphp commits" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/simplesamlphp-commits?hl=en -~----------~----~----~----~------~----~------~--~---
