Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Commit

Permalink
Merge pull request #21 from symfony-cmf/update
Browse files Browse the repository at this point in the history
Fetched core SE
  • Loading branch information
lsmith77 committed Sep 9, 2014
2 parents 7f345e1 + e0e698d commit 21e03c3
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 45 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/app/logs/*
!app/cache/.gitkeep
!app/logs/.gitkeep
/app/phpunit.xml
/build/
/vendor/
/bin/
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 7 additions & 1 deletion app/.htaccess
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
deny from all
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
38 changes: 29 additions & 9 deletions app/SymfonyRequirements.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,18 +409,20 @@ public function __construct()
'Then run "<strong>php composer.phar install</strong>" 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 \"<strong>$baseDir/cache/</strong>\" 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 "<strong>app/cache/</strong>" or "<strong>var/cache/</strong>" 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 \"<strong>$baseDir/logs/</strong>\" 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 "<strong>app/logs/</strong>" or "<strong>var/logs/</strong>" directory so that the web server can write into it.'
);

$this->addPhpIniRequirement(
Expand Down Expand Up @@ -600,6 +602,12 @@ function_exists('utf8_decode'),
'Install and enable the <strong>XML</strong> extension.'
);

$this->addRecommendation(
function_exists('filter_var'),
'filter_var() should be available',
'Install and enable the <strong>filter</strong> extension.'
);

if (!defined('PHP_WINDOWS_VERSION_BUILD')) {
$this->addRecommendation(
function_exists('posix_isatty'),
Expand Down Expand Up @@ -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'))
Expand All @@ -658,9 +668,19 @@ class_exists('Locale'),
$this->addRecommendation(
$accelerator,
'a PHP accelerator should be installed',
'Install and enable a <strong>PHP accelerator</strong> like APC (highly recommended).'
'Install and/or enable a <strong>PHP accelerator</strong> (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 "<strong>realpath_cache_size</strong>" to e.g. "<strong>1024</strong>" in php.ini<a href="#phpini">*</a> to improve performance on windows.'
);
}

$this->addPhpIniRecommendation('short_open_tag', false);

$this->addPhpIniRecommendation('magic_quotes_gpc', false, true);
Expand All @@ -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 <strong>PDO drivers</strong> (mandatory for Doctrine).'
);
Expand Down
6 changes: 3 additions & 3 deletions app/config/config_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -27,7 +27,7 @@ monolog:
# level: info

assetic:
use_controller: true
use_controller: "%use_assetic_controller%"

#swiftmailer:
# delivery_address: [email protected]
4 changes: 4 additions & 0 deletions app/config/parameters.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ parameters:

locale: en
secret: ThisTokenIsNotSoSecretChangeIt

debug_toolbar: true
debug_redirects: false
use_assetic_controller: true
2 changes: 1 addition & 1 deletion app/config/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ security:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false

main:
default:
pattern: ^/
anonymous: ~
form_login:
Expand Down
21 changes: 7 additions & 14 deletions app/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit
backupGlobals = "false"
backupStaticAttributes = "false"
colors = "true"
convertErrorsToExceptions = "true"
convertNoticesToExceptions = "true"
convertWarningsToExceptions = "true"
processIsolation = "false"
stopOnFailure = "false"
syntaxCheck = "false"
bootstrap = "bootstrap.php.cache" >

<!-- http://phpunit.de/manual/4.1/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="bootstrap.php.cache"
>
<testsuites>
<testsuite name="Project Test Suite">
<directory>../src/*/*Bundle/Tests</directory>
Expand All @@ -37,5 +31,4 @@
</exclude>
</whitelist>
</filter>

</phpunit>
20 changes: 10 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
8 changes: 7 additions & 1 deletion src/.htaccess
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
deny from all
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
9 changes: 5 additions & 4 deletions web/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
*/
Expand Down
2 changes: 1 addition & 1 deletion web/app_dev.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
Expand Down

0 comments on commit 21e03c3

Please sign in to comment.