aboutsummaryrefslogtreecommitdiffhomepage
path: root/web
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2018-10-24 21:02:35 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2018-10-24 21:47:51 +0200
commitb502d6ad0964267b49f91eafb3bed8a4693aba0f (patch)
treed362c7b4d064c93846664297a8b316090c89e079 /web
parenta02924ea2618549bacf948188c06092afcd6a8d1 (diff)
downloadwallabag-b502d6ad0964267b49f91eafb3bed8a4693aba0f.tar.gz
wallabag-b502d6ad0964267b49f91eafb3bed8a4693aba0f.tar.zst
wallabag-b502d6ad0964267b49f91eafb3bed8a4693aba0f.zip
Cleanup
Diffstat (limited to 'web')
-rw-r--r--web/app.php7
-rw-r--r--web/app_dev.php12
2 files changed, 5 insertions, 14 deletions
diff --git a/web/app.php b/web/app.php
index 4c2c4650..3427e133 100644
--- a/web/app.php
+++ b/web/app.php
@@ -2,14 +2,9 @@
2 2
3use Symfony\Component\HttpFoundation\Request; 3use Symfony\Component\HttpFoundation\Request;
4 4
5/** 5require __DIR__.'/../vendor/autoload.php';
6 * @var Composer\Autoload\ClassLoader
7 */
8$loader = require __DIR__.'/../app/autoload.php';
9include_once __DIR__.'/../var/bootstrap.php.cache';
10 6
11$kernel = new AppKernel('prod', false); 7$kernel = new AppKernel('prod', false);
12$kernel->loadClassCache();
13//$kernel = new AppCache($kernel); 8//$kernel = new AppCache($kernel);
14 9
15// When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter 10// When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter
diff --git a/web/app_dev.php b/web/app_dev.php
index 8456754d..57e1a433 100644
--- a/web/app_dev.php
+++ b/web/app_dev.php
@@ -1,10 +1,10 @@
1<?php 1<?php
2 2
3use Symfony\Component\HttpFoundation\Request;
4use Symfony\Component\Debug\Debug; 3use Symfony\Component\Debug\Debug;
4use Symfony\Component\HttpFoundation\Request;
5 5
6// If you don't want to setup permissions the proper way, just uncomment the following PHP line 6// If you don't want to setup permissions the proper way, just uncomment the following PHP line
7// read http://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup 7// read https://symfony.com/doc/current/setup.html#checking-symfony-application-configuration-and-setup
8// for more information 8// for more information
9//umask(0000); 9//umask(0000);
10 10
@@ -12,20 +12,16 @@ use Symfony\Component\Debug\Debug;
12// Feel free to remove this, extend it, or make something more sophisticated. 12// Feel free to remove this, extend it, or make something more sophisticated.
13if (isset($_SERVER['HTTP_CLIENT_IP']) 13if (isset($_SERVER['HTTP_CLIENT_IP'])
14 || isset($_SERVER['HTTP_X_FORWARDED_FOR']) 14 || isset($_SERVER['HTTP_X_FORWARDED_FOR'])
15 || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1']) || php_sapi_name() === 'cli-server') 15 || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'], true) || PHP_SAPI === 'cli-server')
16) { 16) {
17 header('HTTP/1.0 403 Forbidden'); 17 header('HTTP/1.0 403 Forbidden');
18 exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.'); 18 exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
19} 19}
20 20
21/** 21require __DIR__.'/../vendor/autoload.php';
22 * @var Composer\Autoload\ClassLoader $loader
23 */
24$loader = require __DIR__.'/../app/autoload.php';
25Debug::enable(); 22Debug::enable();
26 23
27$kernel = new AppKernel('dev', true); 24$kernel = new AppKernel('dev', true);
28$kernel->loadClassCache();
29$request = Request::createFromGlobals(); 25$request = Request::createFromGlobals();
30$response = $kernel->handle($request); 26$response = $kernel->handle($request);
31$response->send(); 27$response->send();