/** * Creates an OpenID response. * * An OpenID response is created based on an OpenID request. The * response will contain the same OpenID version, as well as the same * extension URI-to-alias mapping as the underlying request. * * @param Request $request the request to which the response will * be made */ public function __construct($request = NULL) { if ($request != NULL) { $this->setVersion($request->getVersion()); $this->extension_map = $request->getExtensionMap(); } foreach ($request as $key => $value) { if (strpos($key, 'openid.ns.') === 0) { $alias = substr($key, 10); $this->extension_map[$value] = $alias; } } }
public static function createFromRequest(Request $request) { $response = new Response(); $response->setVersion($request->getVersion()); return $response; }