mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 04:23:19 +00:00
Fix tests on PHP 5.4
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2012 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
/**
|
||||
* Used as a temporary fix for https://github.com/fabpot/Silex/issues/438
|
||||
*
|
||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||
* @link www.phraseanet.com
|
||||
*/
|
||||
class API_V1_Response extends Response
|
||||
{
|
||||
private $originalStatusCode;
|
||||
|
||||
public function setOriginalStatusCode($code)
|
||||
{
|
||||
$this->originalStatusCode = $code;
|
||||
}
|
||||
|
||||
public function getOriginalStatusCode()
|
||||
{
|
||||
return $this->originalStatusCode;
|
||||
}
|
||||
}
|
@@ -9,6 +9,8 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
@@ -358,12 +360,14 @@ class API_V1_result
|
||||
*/
|
||||
public function get_response()
|
||||
{
|
||||
$response = new \API_V1_Response(
|
||||
$response = new Response(
|
||||
$this->format()
|
||||
, $this->get_http_code()
|
||||
, array('Content-Type' => $this->get_content_type())
|
||||
, array(
|
||||
'Content-Type' => $this->get_content_type(),
|
||||
'X-Status-Code'=> $this->get_http_code(),
|
||||
)
|
||||
);
|
||||
$response->setOriginalStatusCode($this->get_http_code());
|
||||
$response->setCharset('UTF-8');
|
||||
|
||||
return $response;
|
||||
|
Reference in New Issue
Block a user