Upgraded to Symfony 2.2
This commit is contained in:
20
web/app.php
20
web/app.php
@@ -1,12 +1,24 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__.'/../app/bootstrap.php.cache';
|
||||
use Symfony\Component\ClassLoader\ApcClassLoader;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
$loader = require_once __DIR__.'/../app/bootstrap.php.cache';
|
||||
|
||||
// Use APC for autoloading to improve performance
|
||||
// Change 'sf2' by the prefix you want in order to prevent key conflict with another application
|
||||
/*
|
||||
$loader = new ApcClassLoader('sf2', $loader);
|
||||
$loader->register(true);
|
||||
*/
|
||||
|
||||
require_once __DIR__.'/../app/AppKernel.php';
|
||||
//require_once __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);
|
||||
|
@@ -1,18 +1,29 @@
|
||||
<?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.
|
||||
require_once __DIR__.'/check_ip.php';
|
||||
|
||||
require_once __DIR__.'/../app/bootstrap.php.cache';
|
||||
require_once __DIR__.'/../app/AppKernel.php';
|
||||
require 'dev-ips.php';
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
// 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 (isset($_SERVER['HTTP_CLIENT_IP'])
|
||||
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|
||||
|| !in_array(@$_SERVER['REMOTE_ADDR'], $dev_ips)
|
||||
) {
|
||||
header('HTTP/1.0 403 Forbidden');
|
||||
exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
|
||||
}
|
||||
|
||||
$loader = require_once __DIR__.'/../app/bootstrap.php.cache';
|
||||
require_once __DIR__.'/../app/AppKernel.php';
|
||||
|
||||
$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);
|
||||
|
@@ -1 +0,0 @@
|
||||
/var/www/vhosts/demo.openscrum.org/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public
|
@@ -1 +0,0 @@
|
||||
/var/www/vhosts/demo.openscrum.org/vendor/bundles/Sensio/Bundle/DistributionBundle/Resources/public
|
@@ -1 +0,0 @@
|
||||
/var/www/vhosts/demo.openscrum.org/vendor/symfony/src/Symfony/Bundle/WebProfilerBundle/Resources/public
|
260
web/config.php
260
web/config.php
@@ -4,203 +4,121 @@ if (!isset($_SERVER['HTTP_HOST'])) {
|
||||
exit('This script cannot be run from the CLI. Run it from a browser.');
|
||||
}
|
||||
|
||||
require_once __DIR__.'/check_ip.php';
|
||||
|
||||
$majorProblems = array();
|
||||
$minorProblems = array();
|
||||
$phpini = false;
|
||||
|
||||
// minimum
|
||||
if (!version_compare(phpversion(), '5.3.2', '>=')) {
|
||||
$version = phpversion();
|
||||
$majorProblems[] = <<<EOF
|
||||
You are running PHP version "<strong>$version</strong>", but Symfony
|
||||
needs at least PHP "<strong>5.3.2</strong>" to run. Before using Symfony, install
|
||||
PHP "<strong>5.3.2</strong>" or newer.
|
||||
EOF;
|
||||
if (!in_array(@$_SERVER['REMOTE_ADDR'], array(
|
||||
'127.0.0.1',
|
||||
'::1',
|
||||
))) {
|
||||
header('HTTP/1.0 403 Forbidden');
|
||||
exit('This script is only accessible from localhost.');
|
||||
}
|
||||
|
||||
if (!is_writable(__DIR__ . '/../app/cache')) {
|
||||
$majorProblems[] = 'Change the permissions of the "<strong>app/cache/</strong>"
|
||||
directory so that the web server can write into it.';
|
||||
}
|
||||
require_once dirname(__FILE__).'/../app/SymfonyRequirements.php';
|
||||
|
||||
if (!is_writable(__DIR__ . '/../app/logs')) {
|
||||
$majorProblems[] = 'Change the permissions of the "<strong>app/logs/</strong>"
|
||||
directory so that the web server can write into it.';
|
||||
}
|
||||
$symfonyRequirements = new SymfonyRequirements();
|
||||
|
||||
// extensions
|
||||
if (!class_exists('DomDocument')) {
|
||||
$minorProblems[] = 'Install and enable the <strong>php-xml</strong> module.';
|
||||
}
|
||||
$majorProblems = $symfonyRequirements->getFailedRequirements();
|
||||
$minorProblems = $symfonyRequirements->getFailedRecommendations();
|
||||
|
||||
if (!((function_exists('apc_store') && ini_get('apc.enabled')) || function_exists('eaccelerator_put') && ini_get('eaccelerator.enable') || function_exists('xcache_set'))) {
|
||||
$minorProblems[] = 'Install and enable a <strong>PHP accelerator</strong> like APC (highly recommended).';
|
||||
}
|
||||
|
||||
if (!(!(function_exists('apc_store') && ini_get('apc.enabled')) || version_compare(phpversion('apc'), '3.0.17', '>='))) {
|
||||
$majorProblems[] = 'Upgrade your <strong>APC</strong> extension (3.0.17+)';
|
||||
}
|
||||
|
||||
if (!function_exists('token_get_all')) {
|
||||
$minorProblems[] = 'Install and enable the <strong>Tokenizer</strong> extension.';
|
||||
}
|
||||
|
||||
if (!function_exists('mb_strlen')) {
|
||||
$minorProblems[] = 'Install and enable the <strong>mbstring</strong> extension.';
|
||||
}
|
||||
|
||||
if (!function_exists('iconv')) {
|
||||
$minorProblems[] = 'Install and enable the <strong>iconv</strong> extension.';
|
||||
}
|
||||
|
||||
if (!function_exists('utf8_decode')) {
|
||||
$minorProblems[] = 'Install and enable the <strong>XML</strong> extension.';
|
||||
}
|
||||
|
||||
if (PHP_OS != 'WINNT' && !function_exists('posix_isatty')) {
|
||||
$minorProblems[] = 'Install and enable the <strong>php_posix</strong> extension (used to colorize the CLI output).';
|
||||
}
|
||||
|
||||
if (!class_exists('Locale')) {
|
||||
$minorProblems[] = 'Install and enable the <strong>intl</strong> extension.';
|
||||
} else {
|
||||
$version = '';
|
||||
|
||||
if (defined('INTL_ICU_VERSION')) {
|
||||
$version = INTL_ICU_VERSION;
|
||||
} else {
|
||||
$reflector = new \ReflectionExtension('intl');
|
||||
|
||||
ob_start();
|
||||
$reflector->info();
|
||||
$output = strip_tags(ob_get_clean());
|
||||
|
||||
preg_match('/^ICU version (.*)$/m', $output, $matches);
|
||||
$version = $matches[1];
|
||||
}
|
||||
|
||||
if (!version_compare($version, '4.0', '>=')) {
|
||||
$minorProblems[] = 'Upgrade your <strong>intl</strong> extension with a newer ICU version (4+).';
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists('SQLite3') && !in_array('sqlite', PDO::getAvailableDrivers())) {
|
||||
$majorProblems[] = 'Install and enable the <strong>SQLite3</strong> or <strong>PDO_SQLite</strong> extension.';
|
||||
}
|
||||
|
||||
if (!function_exists('json_encode')) {
|
||||
$majorProblems[] = 'Install and enable the <strong>json</strong> extension.';
|
||||
}
|
||||
|
||||
if (!function_exists('session_start')) {
|
||||
$majorProblems[] = 'Install and enable the <strong>session</strong> extension.';
|
||||
}
|
||||
|
||||
if (!function_exists('ctype_alpha')) {
|
||||
$majorProblems[] = 'Install and enable the <strong>ctype</strong> extension.';
|
||||
}
|
||||
|
||||
if (!function_exists('token_get_all')) {
|
||||
$majorProblems[] = 'Install and enable the <strong>Tokenizer</strong> extension.';
|
||||
}
|
||||
|
||||
// php.ini
|
||||
if (!ini_get('date.timezone')) {
|
||||
$phpini = true;
|
||||
$majorProblems[] = 'Set the "<strong>date.timezone</strong>" setting in php.ini<a href="#phpini">*</a> (like Europe/Paris).';
|
||||
}
|
||||
|
||||
if (ini_get('short_open_tag')) {
|
||||
$phpini = true;
|
||||
$minorProblems[] = 'Set <strong>short_open_tag</strong> to <strong>off</strong> in php.ini<a href="#phpini">*</a>.';
|
||||
}
|
||||
|
||||
if (ini_get('magic_quotes_gpc')) {
|
||||
$phpini = true;
|
||||
$minorProblems[] = 'Set <strong>magic_quotes_gpc</strong> to <strong>off</strong> in php.ini<a href="#phpini">*</a>.';
|
||||
}
|
||||
|
||||
if (ini_get('register_globals')) {
|
||||
$phpini = true;
|
||||
$minorProblems[] = 'Set <strong>register_globals</strong> to <strong>off</strong> in php.ini<a href="#phpini">*</a>.';
|
||||
}
|
||||
|
||||
if (ini_get('session.auto_start')) {
|
||||
$phpini = true;
|
||||
$minorProblems[] = 'Set <strong>session.auto_start</strong> to <strong>off</strong> in php.ini<a href="#phpini">*</a>.';
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link href="bundles/sensiodistribution/webconfigurator/css/install.css" rel="stylesheet" media="all" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<meta name="robots" content="noindex,nofollow" />
|
||||
<title>Symfony Configuration</title>
|
||||
<link rel="stylesheet" href="bundles/framework/css/structure.css" media="all" />
|
||||
<link rel="stylesheet" href="bundles/framework/css/body.css" media="all" />
|
||||
<link rel="stylesheet" href="bundles/sensiodistribution/webconfigurator/css/install.css" media="all" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="symfony-wrapper">
|
||||
<div id="symfony-content">
|
||||
<div class="symfony-blocks-install">
|
||||
<div class="symfony-block-logo">
|
||||
<img src="bundles/sensiodistribution/webconfigurator/images/logo-big.gif" alt="sf_symfony" />
|
||||
<div id="content">
|
||||
<div class="header clear-fix">
|
||||
<div class="header-logo">
|
||||
<img src="bundles/framework/images/logo_symfony.png" alt="Symfony" />
|
||||
</div>
|
||||
|
||||
<div class="symfony-block-content">
|
||||
<h1>Welcome!</h1>
|
||||
<p>Welcome to your new Symfony project.</p>
|
||||
<p>This script will guide you through the basic configuration of your project. You can also do the same by editing the ‘<strong>app/config/parameters.ini</strong>’ file directly.</p>
|
||||
<div class="search">
|
||||
<form method="get" action="http://symfony.com/search">
|
||||
<div class="form-row">
|
||||
|
||||
<?php if (count($majorProblems)): ?>
|
||||
<h2>
|
||||
<span><?php echo count($majorProblems) ?> Major problems</span>
|
||||
</h2>
|
||||
<p>Major problems have been detected and <strong>must</strong> be fixed before continuing :</p>
|
||||
<ol>
|
||||
<?php foreach ($majorProblems as $problem): ?>
|
||||
<li><?php echo $problem; ?></li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
<?php endif ?>
|
||||
<label for="search-id">
|
||||
<img src="bundles/framework/images/grey_magnifier.png" alt="Search on Symfony website" />
|
||||
</label>
|
||||
|
||||
<?php if (count($minorProblems)): ?>
|
||||
<h2>Recommendations</h2>
|
||||
<input name="q" id="search-id" type="search" placeholder="Search on Symfony website" />
|
||||
|
||||
<button type="submit" class="sf-button">
|
||||
<span class="border-l">
|
||||
<span class="border-r">
|
||||
<span class="btn-bg">OK</span>
|
||||
</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sf-reset">
|
||||
<div class="block">
|
||||
<div class="symfony-block-content">
|
||||
<h1 class="title">Welcome!</h1>
|
||||
<p>Welcome to your new Symfony project.</p>
|
||||
<p>
|
||||
<?php if ($majorProblems): ?>
|
||||
Additionally, to
|
||||
<?php else: ?>
|
||||
To<?php endif; ?>
|
||||
enhance your Symfony experience, it’s recommended that you fix the following :
|
||||
This script will guide you through the basic configuration of your project.
|
||||
You can also do the same by editing the ‘<strong>app/config/parameters.yml</strong>’ file directly.
|
||||
</p>
|
||||
<ol>
|
||||
<?php foreach ($minorProblems as $problem): ?>
|
||||
<li><?php echo $problem; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($phpini): ?>
|
||||
<a id="phpini"></a>
|
||||
<p>*
|
||||
<?php if (get_cfg_var('cfg_file_path')): ?>
|
||||
Changes to the <strong>php.ini</strong> file must be done in "<strong><?php echo get_cfg_var('cfg_file_path') ?></strong>".
|
||||
<?php if (count($majorProblems)): ?>
|
||||
<h2 class="ko">Major problems</h2>
|
||||
<p>Major problems have been detected and <strong>must</strong> be fixed before continuing:</p>
|
||||
<ol>
|
||||
<?php foreach ($majorProblems as $problem): ?>
|
||||
<li><?php echo $problem->getHelpHtml() ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (count($minorProblems)): ?>
|
||||
<h2>Recommendations</h2>
|
||||
<p>
|
||||
<?php if (count($majorProblems)): ?>Additionally, to<?php else: ?>To<?php endif; ?> enhance your Symfony experience,
|
||||
it’s recommended that you fix the following:
|
||||
</p>
|
||||
<ol>
|
||||
<?php foreach ($minorProblems as $problem): ?>
|
||||
<li><?php echo $problem->getHelpHtml() ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($symfonyRequirements->hasPhpIniConfigIssue()): ?>
|
||||
<p id="phpini">*
|
||||
<?php if ($symfonyRequirements->getPhpIniConfigPath()): ?>
|
||||
Changes to the <strong>php.ini</strong> file must be done in "<strong><?php echo $symfonyRequirements->getPhpIniConfigPath() ?></strong>".
|
||||
<?php else: ?>
|
||||
To change settings, create a "<strong>php.ini</strong>".
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<ul class="symfony-install-continue">
|
||||
<?php if (!count($majorProblems)): ?>
|
||||
<li><a href="app_dev.php/_configurator/">Configure your Symfony Application online</a></li>
|
||||
<li><a href="app_dev.php/">Bypass configuration and go to the Welcome page</a></li>
|
||||
<?php endif ?>
|
||||
<li><a href="config.php">Re-check configuration</a></li>
|
||||
</ul>
|
||||
<?php if (!count($majorProblems) && !count($minorProblems)): ?>
|
||||
<p class="ok">Your configuration looks good to run Symfony.</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<ul class="symfony-install-continue">
|
||||
<?php if (!count($majorProblems)): ?>
|
||||
<li><a href="app_dev.php/_configurator/">Configure your Symfony Application online</a></li>
|
||||
<li><a href="app_dev.php/">Bypass configuration and go to the Welcome page</a></li>
|
||||
<?php endif; ?>
|
||||
<?php if (count($majorProblems) || count($minorProblems)): ?>
|
||||
<li><a href="config.php">Re-check configuration</a></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="version">Symfony Standard Edition</div>
|
||||
</div>
|
||||
<div class="version">Symfony Standard Edition</div>
|
||||
</body>
|
||||
</html>
|
||||
|
6
web/dev-ips.php
Normal file
6
web/dev-ips.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
$dev_ips = array(
|
||||
'127.0.0.1',
|
||||
'::1',
|
||||
);
|
||||
|
Reference in New Issue
Block a user