Skip to content

Commit 038ab09

Browse files
committed
Merge pull request #329 from symfony-cmf/sf3
Run on Symfony 3.1
2 parents 8a046db + 6a70e82 commit 038ab09

23 files changed

+1454
-1499
lines changed

.styleci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
preset: symfony
22

3-
disabled: [phpdoc_to_comment]
3+
disabled: [phpdoc_to_comment, phpdoc_var_without_name]

.travis.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
language: php
22

33
php:
4-
- 5.3
5-
- 5.4
64
- 5.5
7-
# 5.6 is tested using composer install
8-
- 7.0
5+
- 5.6
6+
# 7.0 is tested using composer install
97
- hhvm
108

119
sudo: false
@@ -17,18 +15,22 @@ cache:
1715
matrix:
1816
fast_finish: true
1917
include:
20-
- php: 5.6
18+
- php: 7.0
2119
env: TRANSPORT=jackrabbit COMPOSER_INSTALL=1
22-
- php: 5.6
20+
- php: 7.0
2321
env: TRANSPORT=doctrine_dbal COMPOSER_INSTALL=1
2422

2523
env:
26-
- TRANSPORT=jackrabbit
27-
- TRANSPORT=doctrine_dbal
24+
global:
25+
- SYMFONY_DEPRECATIONS_HELPER=weak
26+
matrix:
27+
- TRANSPORT=jackrabbit
28+
- TRANSPORT=doctrine_dbal
2829

2930
before_install:
30-
- composer self-update
3131
- if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then echo "memory_limit = -1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi
32+
- phpenv config-rm xdebug.ini || true
33+
- composer self-update
3234

3335
install: if [ "$COMPOSER_INSTALL" != "1" ]; then composer update --no-scripts --prefer-dist; else composer install --no-scripts --prefer-dist; fi
3436

app/AppKernel.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ public function registerBundles()
3737
new Symfony\Cmf\Bundle\TreeBrowserBundle\CmfTreeBrowserBundle(),
3838
new Symfony\Cmf\Bundle\BlockBundle\CmfBlockBundle(),
3939
new Symfony\Cmf\Bundle\SeoBundle\CmfSeoBundle(),
40-
new Burgov\Bundle\KeyValueFormBundle\BurgovKeyValueFormBundle(),
4140
new Symfony\Cmf\Bundle\RoutingAutoBundle\CmfRoutingAutoBundle(),
41+
new Symfony\Cmf\Bundle\ResourceBundle\CmfResourceBundle(),
42+
new Symfony\Cmf\Bundle\ResourceRestBundle\CmfResourceRestBundle(),
4243

4344
// language switcher
4445
new Lunetics\LocaleBundle\LuneticsLocaleBundle(),
@@ -48,15 +49,14 @@ public function registerBundles()
4849
new JMS\SerializerBundle\JMSSerializerBundle(),
4950

5051
// admin bundle
51-
new Sonata\jQueryBundle\SonatajQueryBundle(),
5252
new Sonata\BlockBundle\SonataBlockBundle(),
5353
new Sonata\CoreBundle\SonataCoreBundle(),
5454
new Sonata\AdminBundle\SonataAdminBundle(),
5555
new Sonata\DoctrinePHPCRAdminBundle\SonataDoctrinePHPCRAdminBundle(),
5656
new Sonata\SeoBundle\SonataSeoBundle(),
5757
new Sonata\TranslationBundle\SonataTranslationBundle(),
58-
new FOS\JsRoutingBundle\FOSJsRoutingBundle(),
5958
new Ivory\CKEditorBundle\IvoryCKEditorBundle(),
59+
new Burgov\Bundle\KeyValueFormBundle\BurgovKeyValueFormBundle(),
6060

6161
// jackalope doctrine caching
6262
new Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(),

app/autoload.php

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,13 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
if (!$loader = include __DIR__.'/../vendor/autoload.php') {
13-
$nl = PHP_SAPI === 'cli' ? PHP_EOL : '<br />';
14-
echo "$nl$nl";
15-
die('You must set up the project dependencies.'.$nl.
16-
'Run the following commands in '.dirname(__DIR__).':'.$nl.$nl.
17-
'curl -s http://getcomposer.org/installer | php'.$nl.
18-
'php composer.phar install'.$nl);
19-
}
20-
2112
use Doctrine\Common\Annotations\AnnotationRegistry;
13+
use Composer\Autoload\ClassLoader;
2214

23-
// intl
24-
if (!function_exists('intl_get_error_code')) {
25-
require_once __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
26-
27-
$loader->add('', __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs');
28-
}
15+
/**
16+
* @var ClassLoader $loader
17+
*/
18+
$loader = require __DIR__.'/../vendor/autoload.php';
2919

3020
AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
3121

app/config/config.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,15 @@ cmf_menu:
118118
voters:
119119
content_identity: ~
120120

121+
cmf_resource:
122+
repositories:
123+
default:
124+
type: doctrine_phpcr_odm
125+
126+
cmf_resource_rest:
127+
enhancer_map:
128+
- { repository: default, enhancer: sonata_admin }
129+
121130
sonata_block:
122131
default_contexts: [cms]
123132
blocks:

app/config/routing.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,29 @@ _app:
88
type: annotation
99

1010
home_redirect:
11-
pattern: /
11+
path: /
1212
defaults:
1313
_controller: lunetics_locale.switcher_controller:switchAction
1414
route: '/cms/routes/%locale%'
1515
statusCode: 301
1616
useReferrer: false
1717

1818
admin_wo_locale:
19-
pattern: /admin
19+
path: /admin
2020
defaults:
2121
_controller: FrameworkBundle:Redirect:redirect
2222
route: sonata_admin_dashboard
2323
permanent: true # this for 301
2424

2525
admin_dashboard_wo_locale:
26-
pattern: /admin/dashboard
26+
path: /admin/dashboard
2727
defaults:
2828
_controller: FrameworkBundle:Redirect:redirect
2929
route: sonata_admin_dashboard
3030
permanent: true # this for 301
3131

3232
admin_dashboard:
33-
pattern: /{_locale}/admin/
33+
path: /{_locale}/admin/
3434
defaults:
3535
_controller: FrameworkBundle:Redirect:redirect
3636
route: sonata_admin_dashboard
@@ -45,13 +45,10 @@ sonata_admin:
4545
type: sonata_admin
4646
prefix: /{_locale}/admin
4747

48-
fos_js_routing:
49-
resource: '@FOSJsRoutingBundle/Resources/config/routing/routing.xml'
50-
51-
cmf_tree:
52-
resource: .
53-
type: 'cmf_tree'
54-
5548
block_cache:
5649
resource: '@CmfBlockBundle/Resources/config/routing/cache.xml'
5750
prefix: /
51+
52+
cmf_resource:
53+
resource: '@CmfResourceRestBundle/Resources/config/routing.yml'
54+
prefix: /admin

app/config/routing_dev.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,5 @@ _profiler:
66
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
77
prefix: /_profiler
88

9-
_configurator:
10-
resource: '@SensioDistributionBundle/Resources/config/routing/webconfigurator.xml'
11-
prefix: /_configurator
12-
139
_main:
1410
resource: routing.yml
15-
16-

app/config/security.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,3 @@ security:
2525
access_control:
2626
- { path: ^(/(de|fr|en))?/admin, roles: ROLE_ADMIN }
2727
#- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
28-
- { path: ^/efconnect, role: ROLE_USER }
29-
- { path: ^/elfinder, role: ROLE_USER }

app/console

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
11
#!/usr/bin/env php
22
<?php
33

4+
use Symfony\Bundle\FrameworkBundle\Console\Application;
5+
use Symfony\Component\Console\Input\ArgvInput;
6+
use Symfony\Component\Debug\Debug;
7+
48
// if you don't want to setup permissions the proper way, just uncomment the following PHP line
59
// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
610
//umask(0000);
711

812
set_time_limit(0);
913

10-
require_once __DIR__.'/bootstrap.php.cache';
11-
require_once __DIR__.'/AppKernel.php';
12-
13-
use Symfony\Bundle\FrameworkBundle\Console\Application;
14-
use Symfony\Component\Console\Input\ArgvInput;
14+
/**
15+
* @var Composer\Autoload\ClassLoader $loader
16+
*/
17+
$loader = require __DIR__.'/../app/autoload.php';
1518

1619
$input = new ArgvInput();
1720
$env = $input->getParameterOption(array('--env', '-e'), getenv('SYMFONY_ENV') ?: 'dev');
1821
$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(array('--no-debug', '')) && $env !== 'prod';
1922

23+
if ($debug) {
24+
Debug::enable();
25+
}
26+
2027
$kernel = new AppKernel($env, $debug);
2128
$application = new Application($kernel);
2229
$application->run($input);

app/phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
processIsolation="false"
1212
stopOnFailure="false"
1313
syntaxCheck="false"
14-
bootstrap="tests/bootstrap.php" >
14+
bootstrap="autoload.php">
1515

1616
<testsuites>
1717
<testsuite name="Project Test Suite">

0 commit comments

Comments
 (0)