diff --git a/.gitignore b/.gitignore index 481c83ed72..1a193d3de9 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ /app/logs/* !app/cache/.gitkeep !app/logs/.gitkeep +/app/phpunit.xml /build/ /vendor/ /bin/ diff --git a/LICENSE b/LICENSE index 88a57f8d8d..b832f11e04 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2013 Fabien Potencier +Copyright (c) 2004-2014 Symfony CMF Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/app/.htaccess b/app/.htaccess index 3418e55a68..fb1de45bdb 100644 --- a/app/.htaccess +++ b/app/.htaccess @@ -1 +1,7 @@ -deny from all \ No newline at end of file + + Require all denied + + + Order deny,allow + Deny from all + diff --git a/app/SymfonyRequirements.php b/app/SymfonyRequirements.php index fb70f803fd..25bc938e25 100644 --- a/app/SymfonyRequirements.php +++ b/app/SymfonyRequirements.php @@ -409,18 +409,20 @@ public function __construct() 'Then run "php composer.phar install" to install them.' ); - $baseDir = basename(__DIR__); + $cacheDir = is_dir(__DIR__.'/../var/cache') ? __DIR__.'/../var/cache' : __DIR__.'/cache'; $this->addRequirement( - is_writable(__DIR__.'/cache'), - "$baseDir/cache/ directory must be writable", - "Change the permissions of the \"$baseDir/cache/\" directory so that the web server can write into it." + is_writable($cacheDir), + 'app/cache/ or var/cache/ directory must be writable', + 'Change the permissions of either "app/cache/" or "var/cache/" directory so that the web server can write into it.' ); + $logsDir = is_dir(__DIR__.'/../var/logs') ? __DIR__.'/../var/logs' : __DIR__.'/logs'; + $this->addRequirement( - is_writable(__DIR__.'/logs'), - "$baseDir/logs/ directory must be writable", - "Change the permissions of the \"$baseDir/logs/\" directory so that the web server can write into it." + is_writable($logsDir), + 'app/logs/ or var/logs/ directory must be writable', + 'Change the permissions of either "app/logs/" or "var/logs/" directory so that the web server can write into it.' ); $this->addPhpIniRequirement( @@ -600,6 +602,12 @@ function_exists('utf8_decode'), 'Install and enable the XML extension.' ); + $this->addRecommendation( + function_exists('filter_var'), + 'filter_var() should be available', + 'Install and enable the filter extension.' + ); + if (!defined('PHP_WINDOWS_VERSION_BUILD')) { $this->addRecommendation( function_exists('posix_isatty'), @@ -648,6 +656,8 @@ class_exists('Locale'), || (extension_loaded('apc') && ini_get('apc.enabled')) || + (extension_loaded('Zend Optimizer+') && ini_get('zend_optimizerplus.enable')) + || (extension_loaded('Zend OPcache') && ini_get('opcache.enable')) || (extension_loaded('xcache') && ini_get('xcache.cacher')) @@ -658,9 +668,19 @@ class_exists('Locale'), $this->addRecommendation( $accelerator, 'a PHP accelerator should be installed', - 'Install and enable a PHP accelerator like APC (highly recommended).' + 'Install and/or enable a PHP accelerator (highly recommended).' ); + if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { + $this->addPhpIniRecommendation( + 'realpath_cache_size', + create_function('$cfgValue', 'return (int) $cfgValue > 1000;'), + false, + 'realpath_cache_size should be above 1024 in php.ini', + 'Set "realpath_cache_size" to e.g. "1024" in php.ini* to improve performance on windows.' + ); + } + $this->addPhpIniRecommendation('short_open_tag', false); $this->addPhpIniRecommendation('magic_quotes_gpc', false, true); @@ -678,7 +698,7 @@ class_exists('PDO'), if (class_exists('PDO')) { $drivers = PDO::getAvailableDrivers(); $this->addRecommendation( - count($drivers), + count($drivers) > 0, sprintf('PDO should have some drivers installed (currently available: %s)', count($drivers) ? implode(', ', $drivers) : 'none'), 'Install PDO drivers (mandatory for Doctrine).' ); diff --git a/app/config/config_dev.yml b/app/config/config_dev.yml index a724592dff..afdabf29cc 100644 --- a/app/config/config_dev.yml +++ b/app/config/config_dev.yml @@ -8,8 +8,8 @@ framework: profiler: { only_exceptions: false } web_profiler: - toolbar: true - intercept_redirects: false + toolbar: "%debug_toolbar%" + intercept_redirects: "%debug_redirects%" monolog: handlers: @@ -27,7 +27,7 @@ monolog: # level: info assetic: - use_controller: true + use_controller: "%use_assetic_controller%" #swiftmailer: # delivery_address: me@example.com diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist index 06e291daf5..c73c650366 100644 --- a/app/config/parameters.yml.dist +++ b/app/config/parameters.yml.dist @@ -20,3 +20,7 @@ parameters: locale: en secret: ThisTokenIsNotSoSecretChangeIt + + debug_toolbar: true + debug_redirects: false + use_assetic_controller: true diff --git a/app/config/security.yml b/app/config/security.yml index 4428fba1f3..341507be52 100644 --- a/app/config/security.yml +++ b/app/config/security.yml @@ -18,7 +18,7 @@ security: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false - main: + default: pattern: ^/ anonymous: ~ form_login: diff --git a/app/phpunit.xml.dist b/app/phpunit.xml.dist index 1e31086ded..4a831565a0 100644 --- a/app/phpunit.xml.dist +++ b/app/phpunit.xml.dist @@ -1,18 +1,12 @@ - - - + + ../src/*/*Bundle/Tests @@ -37,5 +31,4 @@ - diff --git a/composer.json b/composer.json index 3df7f9390b..520615ad6c 100644 --- a/composer.json +++ b/composer.json @@ -16,26 +16,26 @@ "minimum-stability": "dev", "require": { "php": ">=5.3.3", - "symfony/symfony": "2.3.*", + "symfony/symfony": "~2.5", "jackalope/jackalope-doctrine-dbal": "1.1.*", - "doctrine/doctrine-bundle": "1.2.*", + "doctrine/doctrine-bundle": "~1.2", "doctrine/data-fixtures": "1.0.*", "doctrine/doctrine-cache-bundle": "1.0.*", - "twig/extensions": "1.0.*", - "symfony/assetic-bundle": "2.3.*", - "symfony/swiftmailer-bundle": "2.3.*", - "symfony/monolog-bundle": "2.3.*", + "twig/extensions": "~1.0", + "symfony/assetic-bundle": "~2.3", + "symfony/swiftmailer-bundle": "~2.3", + "symfony/monolog-bundle": "~2.4", "symfony-cmf/symfony-cmf": "1.2.*", "symfony-cmf/simple-cms-bundle": "1.2.*", "symfony-cmf/create-bundle": "1.2.*", - "sensio/distribution-bundle": "2.3.*", - "sensio/framework-extra-bundle": "2.3.*", - "sensio/generator-bundle": "2.3.*", + "sensio/distribution-bundle": "~3.0", + "sensio/framework-extra-bundle": "~3.0", "incenteev/composer-parameter-handler": "~2.0", "nelmio/alice": "1.*" }, "require-dev": { - "liip/functional-test-bundle": "1.0.*" + "liip/functional-test-bundle": "1.0.*", + "sensio/generator-bundle": "~2.3" }, "scripts": { "post-install-cmd": [ diff --git a/src/.htaccess b/src/.htaccess index 3418e55a68..fb1de45bdb 100644 --- a/src/.htaccess +++ b/src/.htaccess @@ -1 +1,7 @@ -deny from all \ No newline at end of file + + Require all denied + + + Order deny,allow + Deny from all + diff --git a/web/app.php b/web/app.php index 4f591c107c..c5c2640906 100644 --- a/web/app.php +++ b/web/app.php @@ -5,11 +5,12 @@ $loader = require_once __DIR__.'/../app/bootstrap.php.cache'; -// Use APC for autoloading to improve performance. -// Change 'sf2' to a unique prefix in order to prevent cache key conflicts -// with other applications also using APC. +// Enable APC for autoloading to improve performance. +// You should change the ApcClassLoader first argument to a unique prefix +// in order to prevent cache key conflicts with other applications +// also using APC. /* -$apcLoader = new ApcClassLoader('sf2', $loader); +$apcLoader = new ApcClassLoader(sha1(__FILE__), $loader); $loader->unregister(); $apcLoader->register(true); */ diff --git a/web/app_dev.php b/web/app_dev.php index 872a882835..e0279c2aeb 100644 --- a/web/app_dev.php +++ b/web/app_dev.php @@ -11,7 +11,7 @@ // 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'], array('127.0.0.1', 'fe80::1', '::1')) + || !(in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', 'fe80::1', '::1')) || php_sapi_name() === 'cli-server') ) { header('HTTP/1.0 403 Forbidden'); exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');