mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-09 19:13:26 +00:00
Update applications
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea;
|
||||
|
||||
use Alchemy\Phrasea\PhraseanetServiceProvider;
|
||||
@@ -408,4 +417,3 @@ class Application extends SilexApplication
|
||||
return static::$availableLanguages;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
|
||||
namespace Alchemy\Phrasea\Application;
|
||||
|
||||
use Alchemy\Phrasea\BaseApplication;
|
||||
use Alchemy\Phrasea\Application as PhraseaApplication;
|
||||
use Silex\Application as SilexApplication;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
@@ -21,7 +21,8 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
return call_user_func(function($environment = 'prod') {
|
||||
|
||||
$app = new BaseApplication($environment);
|
||||
$app = new PhraseaApplication($environment);
|
||||
|
||||
/**
|
||||
* disable session
|
||||
*/
|
||||
@@ -693,6 +694,7 @@ return call_user_func(function($environment = 'prod') {
|
||||
|
||||
$result = $app['api']->get_error_message($app['request'], $code, $e->getMessage());
|
||||
$response = $result->get_response();
|
||||
$response->headers->set('X-Status-Code', $result->get_http_code());
|
||||
|
||||
foreach ($headers as $key => $value) {
|
||||
$response->headers->set($key, $value);
|
||||
|
@@ -361,12 +361,9 @@ class API_V1_result
|
||||
public function get_response()
|
||||
{
|
||||
$response = new Response(
|
||||
$this->format()
|
||||
, $this->get_http_code()
|
||||
, array(
|
||||
'Content-Type' => $this->get_content_type(),
|
||||
'X-Status-Code'=> $this->get_http_code(),
|
||||
)
|
||||
$this->format(),
|
||||
$this->get_http_code(),
|
||||
array('Content-Type' => $this->get_content_type())
|
||||
);
|
||||
$response->setCharset('UTF-8');
|
||||
|
||||
|
Reference in New Issue
Block a user