Permalink
Browse files

merged changes from SE

  • Loading branch information...
1 parent fe8656b commit 7a87dda656d52648384a8888b00fd4a3d50bd184 @lsmith77 lsmith77 committed Jan 9, 2012
Showing with 20 additions and 12 deletions.
  1. +7 −5 web/app.php
  2. +13 −7 web/app_dev.php
View
@@ -1,12 +1,14 @@
<?php
-require_once __DIR__ . '/../app/autoload.php';
-require_once __DIR__.'/../app/AppKernel.php';
-//require_once __DIR__.'/../app/AppCache.php';
+require __DIR__ . '/../app/autoload.php';
+require __DIR__ . '/../app/AppKernel.php';
+//require __DIR__.'/../app/AppCache.php';
use Symfony\Component\HttpFoundation\Request;
$kernel = new AppKernel('prod', false);
-$kernel->loadClassCache();
//$kernel = new AppCache($kernel);
-$kernel->handle(Request::createFromGlobals())->send();
+$request = Request::createFromGlobals();
+$response = $kernel->handle($request);
+$response->send();
+$kernel->terminate($request, $response);
View
@@ -1,21 +1,27 @@
<?php
+// if you don't want to setup permissions the proper way, just uncomment the following PHP line
+// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
+//umask(0000);
+
// this check prevents access to debug front controllers that are deployed by accident to production servers.
// feel free to remove this, extend it, or make something more sophisticated.
if (!in_array(@$_SERVER['REMOTE_ADDR'], array(
'127.0.0.1',
'::1',
- '33.33.33.1',
-))) {
+))
+) {
header('HTTP/1.0 403 Forbidden');
- die('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
+ exit('You are not allowed to access this file. Check ' . basename(__FILE__) . ' for more information.');
}
-require_once __DIR__ . '/../app/autoload.php';
-require_once __DIR__.'/../app/AppKernel.php';
+require __DIR__ . '/../app/autoload.php';
+require __DIR__ . '/../app/AppKernel.php';
use Symfony\Component\HttpFoundation\Request;
$kernel = new AppKernel('dev', true);
-$kernel->loadClassCache();
-$kernel->handle(Request::createFromGlobals())->send();
+$request = Request::createFromGlobals();
+$response = $kernel->handle($request);
+$response->send();
+$kernel->terminate($request, $response);

0 comments on commit 7a87dda

Please sign in to comment.