2
2
Derivar 3
Este cometimento está contido em:
Simon Vieille 2018-08-20 16:40:04 +02:00
ascendente 2d8f19437a
cometimento b7e6d8c69c
Não foi encontrada uma chave conhecida para esta assinatura, na base de dados
ID da chave GPG: 919533E2B946EA10
6 ficheiros modificados com 20 adições e 3 eliminações

1
.gitignore externo
Ver ficheiro

@ -11,3 +11,4 @@
/app/config/propel/
/data/
/trans/
/cache/

Ver ficheiro

@ -26,6 +26,7 @@ update:
$(GIT) pull origin master
${MKDIR} -p data/git
${MKDIR} -p data/cache
$(COMPOSER) update
$(NPM) install

Ver ficheiro

@ -9,6 +9,6 @@ $app->register(new TwigServiceProvider(), array(
$app->extend('twig', function ($twig, $app) {
$base = str_replace($app['request']->server->get('SCRIPT_NAME'), '', $app['request']->getBaseUrl());
$twig->addGlobal('web_path', $base.'/');
return $twig;
});

Ver ficheiro

@ -0,0 +1,7 @@
<?php
use Silex\Provider\HttpCacheServiceProvider;
$app->register(new HttpCacheServiceProvider(), array(
'http_cache.cache_dir' => $app['root_path'].'/cache/',
));

Ver ficheiro

@ -175,9 +175,17 @@ abstract class Controller
$params['user'] = $this->getUser();
}
return $app['twig']->render(
$body = $app['twig']->render(
$template,
$params
);
$response = new Response($body);
if (empty($params['no_cache'])) {
$response->setTtl(3600 * 24 * 7);
}
return $response;
}
}

Ver ficheiro

@ -4,4 +4,4 @@ $app = require __DIR__.'/../app/bootstrap.php';
$app['env'] = 'prod';
$app->run();
$app['http_cache']->run();