start using symfony 2 reverse proxy

This commit is contained in:
Manuel Raynaud
2013-10-05 11:52:13 +02:00
parent 5b2d9cd2da
commit 16af55ae77
3 changed files with 55 additions and 1 deletions

View File

@@ -0,0 +1,52 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
namespace Thelia\Core\HttpKernel\HttpCache;
use Symfony\Component\HttpKernel\HttpCache\Esi;
use Symfony\Component\HttpKernel\HttpCache\HttpCache as BaseHttpCache;
use Symfony\Component\HttpKernel\HttpCache\Store;
use Symfony\Component\HttpKernel\HttpKernelInterface;
/**
* Class HttpCache
* @package Thelia\Core\HttpKernel\HttpCache
* @author manuel raynaud <mraynaud@openstudio.fr>
*/
class HttpCache extends BaseHttpCache
{
public function __construct(HttpKernelInterface $kernel, $options = array())
{
parent::__construct(
$kernel,
new Store($kernel->getCacheDir().'/http_cache'),
new Esi(),
array_merge(
array('debug' => $kernel->isDebug()),
$options
)
);
}
}

View File

@@ -67,6 +67,7 @@ class Thelia extends Kernel
if ($this->debug) { if ($this->debug) {
ini_set('display_errors', 1); ini_set('display_errors', 1);
} }
ini_set('display_errors', 1);
$this->initPropel(); $this->initPropel();
} }

View File

@@ -1,4 +1,5 @@
<?php <?php
use Thelia\Core\HttpKernel\HttpCache\HttpCache;
use Thelia\Core\Thelia; use Thelia\Core\Thelia;
use Thelia\Core\HttpFoundation\Request; use Thelia\Core\HttpFoundation\Request;
@@ -10,7 +11,7 @@ require __DIR__ . '/../core/bootstrap.php';
$request = Request::createFromGlobals(); $request = Request::createFromGlobals();
$thelia = new Thelia("prod", false); $thelia = new Thelia("prod", false);
//$thelia = new HttpCache($thelia);
$response = $thelia->handle($request)->prepare($request)->send(); $response = $thelia->handle($request)->prepare($request)->send();
$thelia->terminate($request, $response); $thelia->terminate($request, $response);