/** * Returns response parameters as an array. * * @param sfResponse $response A sfResponse instance * * @return array The response parameters */ public static function responseAsArray(sfResponse $response = null) { if (!$response) { return array(); } return array('status' => array('code' => $response->getStatusCode(), 'text' => $response->getStatusText()), 'options' => $response->getOptions(), 'cookies' => method_exists($response, 'getCookies') ? $response->getCookies() : array(), 'httpHeaders' => method_exists($response, 'getHttpHeaders') ? $response->getHttpHeaders() : array(), 'javascripts' => method_exists($response, 'getJavascripts') ? $response->getJavascripts('ALL') : array(), 'stylesheets' => method_exists($response, 'getStylesheets') ? $response->getStylesheets('ALL') : array(), 'metas' => method_exists($response, 'getMetas') ? $response->getMetas() : array(), 'httpMetas' => method_exists($response, 'getHttpMetas') ? $response->getHttpMetas() : array()); }