8000 minor #50 Improved the help notes of the production front controller … · SofHad/symfony@de0f7ec · GitHub
[go: up one dir, main page]

Skip to content

Commit de0f7ec

Browse files
committed
minor symfony#50 Improved the help notes of the production front controller (javiereguiluz)
This PR was squashed before being merged into the master branch (closes symfony#50). Discussion ---------- Improved the help notes of the production front controller This tries to fix symfony#47 Commits ------- 84af709 Improved the help notes of the production front controller
2 parents a2d5a95 + 84af709 commit de0f7ec

File tree

2 files changed

+24
-11
lines changed

2 files changed

+24
-11
lines changed

web/app.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php
22

3+
// This is the front controller used when executing the application in the
4+
// production environment ('prod'). See
5+
//
6+
// * http://symfony.com/doc/current/cookbook/configuration/front_controllers_and_kernel.html
7+
// * http://symfony.com/doc/current/cookbook/configuration/environments.html
8+
39
use Symfony\Component\ClassLoader\ApcClassLoader;
410
use Symfony\Component\HttpFoundation\Request;
511

@@ -9,14 +15,14 @@
915
// lines to use APC for class autoloading. This can improve application performance
1016
// very significantly. See http://symfony.com/doc/current/components/class_loader/cache_class_loader.html#apcclassloader
1117
//
18+
// NOTE: The first argument of ApcClassLoader() is the prefix used to prevent
19+
// cache key conflicts. In a real Symfony application, make sure to change
20+
// it to a value that it's unique in the web server. A common practice is to use
21+
// the domain name associated to the Symfony application (e.g. 'example_com').
22+
//
1223
// $apcLoader = new ApcClassLoader('symfony_demo', $loader);
1324
// $loader->unregister();
1425
// $apcLoader->register(true);
15-
//
16-
// The first argument of ApcClassLoader() is a prefix that will be used to
17-
// prevent cache key conflicts. In a real Symfony application, make sure to change
18-
// it to a value that it's unique in the web server. A common practice is to use
19-
// the domain name associated to the Symfony application.
2026

2127
require_once __DIR__.'/../app/AppKernel.php';
2228

@@ -27,12 +33,11 @@
2733
// See http://symfony.com/doc/current/book/http_cache.html#symfony-reverse-proxy
2834
//
2935
// require_once __DIR__.'/../app/AppCache.php';
30-
// $kernel = new AppKernel('prod', false);
31-
// $kernel->loadClassCache();
3236
// $kernel = new AppCache($kernel);
3337
// Request::enableHttpMethodParameterOverride();
3438

3539
$request = Request::createFromGlobals();
3640
$response = $kernel->handle($request);
3741
$response->send();
42+
3843
$kernel->terminate($request, $response);

web/app_dev.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
<?php
22

3+
// This is the front controller used when executing the application in the
4+
// development environment ('dev'). See
5+
//
6+
// * http://symfony.com/doc/current/cookbook/configuration/front_controllers_and_kernel.html
7+
// * http://symfony.com/doc/current/cookbook/configuration/environments.html
8+
39
use Symfony\Component\HttpFoundation\Request;
410
use Symfony\Component\Debug\Debug;
511

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#configuration-and-setup for more information
12+
// If you don't want to setup permissions the proper way, just uncomment the
13+
// following PHP line. See:
14+
// http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
815
//umask(0000);
916

10-
// This check prevents access to debug front controllers that are deployed by accident to production servers.
11-
// Feel free to remove this, extend it, or make something more sophisticated.
17+
// This check prevents access to debug front controllers that are deployed by
18+
// accident to production servers. Feel free to remove this, extend it, or make
19+
// something more sophisticated.
1220
if (isset($_SERVER['HTTP_CLIENT_IP'])
1321
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
1422
|| !(in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', 'fe80::1', '::1')) || php_sapi_name() === 'cli-server')

0 commit comments

Comments
 (0)
0