Skip to content

Commit

Permalink
Merge branch 'enhancement/sulu-2-2-4' into 'master'
Browse files Browse the repository at this point in the history
Adjust project to match sulu/skeleton and update to Sulu 2.2.4

See merge request webapps/sulu-demo!102
  • Loading branch information
alexander-schranz committed Feb 9, 2021
2 parents 60cb303 + 806c461 commit 98453fc
Show file tree
Hide file tree
Showing 29 changed files with 2,169 additions and 1,989 deletions.
1,622 changes: 920 additions & 702 deletions assets/admin/package-lock.json

Large diffs are not rendered by default.

1,712 changes: 810 additions & 902 deletions composer.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['all' => true],
Doctrine\Bundle\PHPCRBundle\DoctrinePHPCRBundle::class => ['all' => true],
Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true],
FOS\RestBundle\FOSRestBundle::class => ['all' => true],
HandcraftedInTheAlps\RestRoutingBundle\RestRoutingBundle::class => ['all' => true],
JMS\SerializerBundle\JMSSerializerBundle::class => ['all' => true],
Massive\Bundle\SearchBundle\MassiveSearchBundle::class => ['all' => true],
FOS\HttpCacheBundle\FOSHttpCacheBundle::class => ['all' => true],
Expand Down Expand Up @@ -41,10 +41,10 @@
Sulu\Bundle\PreviewBundle\SuluPreviewBundle::class => ['all' => true, 'admin' => true],
FOS\JsRoutingBundle\FOSJsRoutingBundle::class => ['all' => true, 'admin' => true],
Symfony\Cmf\Bundle\RoutingBundle\CmfRoutingBundle::class => ['all' => true, 'website' => true],
Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true],
Sentry\SentryBundle\SentryBundle::class => ['all' => true],
Sulu\Bundle\ArticleBundle\SuluArticleBundle::class => ['all' => true],
ONGR\ElasticsearchBundle\ONGRElasticsearchBundle::class => ['all' => true],
Task\TaskBundle\TaskBundle::class => ['all' => true],
Sulu\Bundle\AutomationBundle\SuluAutomationBundle::class => ['all' => true],
HandcraftedInTheAlps\RestRoutingBundle\RestRoutingBundle::class => ['all' => true],
];
6 changes: 3 additions & 3 deletions config/packages/dev/monolog.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: ["!event"]
# uncomment to get logging in your browser
# you may have to allow bigger header sizes in your Web server configuration
Expand Down
3 changes: 0 additions & 3 deletions config/packages/dev/routing.yaml

This file was deleted.

10 changes: 5 additions & 5 deletions config/packages/doctrine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ parameters:

doctrine:
dbal:
# configure these for your database server
url: '%env(resolve:DATABASE_URL)%'

# IMPORTANT: You MUST configure your server version,
# either here or in the DATABASE_URL env var (see .env file)
driver: 'pdo_mysql'
server_version: '5.7'
charset: utf8mb4
default_table_options:
charset: utf8mb4
collate: utf8mb4_unicode_ci

url: '%env(resolve:DATABASE_URL)%'

orm:
auto_generate_proxy_classes: true
naming_strategy: doctrine.orm.naming_strategy.underscore
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
auto_mapping: true
mappings:
App:
Expand Down
3 changes: 3 additions & 0 deletions config/packages/massive_search.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ parameters:
massive_search:
metadata:
prefix: '%env(resolve:MASSIVE_SEARCH_PREFIX)%'

# By default massive search uses zend lucene index saved in var/indexes folder
# For multi server setup you can switch to the elasticsearch adapter:
adapter: elastic
adapters:
elastic:
Expand Down
3 changes: 1 addition & 2 deletions config/packages/prod/monolog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ monolog:
excluded_http_codes: [404, 405]
buffer_size: 50 # How many messages should be saved? Prevent memory leaks
nested:
type: rotating_file
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
max_files: 14
console:
type: console
process_psr_3_messages: false
Expand Down
9 changes: 6 additions & 3 deletions config/packages/prod/sulu_http_cache.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
sulu_http_cache:
proxy_client:
symfony:
enabled: false
enabled: false # disable this when varnish is used

# Varnish Configuration:
#
# See: https://docs.sulu.io/en/2.0/cookbook/caching-with-varnish.html
# Changes in the public/index.php is needed to disable the symfony http cache and use varnish instead
varnish:
enabled: true
servers:
- '%env(resolve:VARNISH_SERVER)%'
tags:
enabled: true
29 changes: 29 additions & 0 deletions config/packages/security_website.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,30 @@
# To enable security bundle for website you need to change `config/bundles.php` file
#security:
# encoders:
# Sulu\Bundle\SecurityBundle\Entity\User: bcrypt
#
# providers:
# sulu:
# id: sulu_security.user_provider
#
# firewalls:
# website:
# pattern: ^/
# anonymous: lazy
# # The login and logout routes need to be created.
# # For an advanced user management with registration and opt-in emails have a look at the:
# # https://github.com/sulu/SuluCommunityBundle
# form_login:
# login_path: login
# check_path: login
# logout:
# path: logout
# target: /
# remember_me:
# secret: "%kernel.secret%"
# lifetime: 604800 # 1 week in seconds
# path: /
#
#sulu_security:
# checker:
# enabled: true
3 changes: 0 additions & 3 deletions config/packages/test/routing.yaml

This file was deleted.

4 changes: 1 addition & 3 deletions config/packages/twig.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
twig:
paths: ['%kernel.project_dir%/templates']
debug: '%kernel.debug%'
strict_variables: '%kernel.debug%'
default_path: '%kernel.project_dir%/templates'
8 changes: 4 additions & 4 deletions config/router.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
require ini_get('auto_prepend_file');
}

if (is_file($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $_SERVER['SCRIPT_NAME'])) {
if (is_file($_SERVER['DOCUMENT_ROOT'] . \DIRECTORY_SEPARATOR . $_SERVER['SCRIPT_NAME'])) {
return false;
}

$script = isset($_ENV['APP_FRONT_CONTROLLER']) ? $_ENV['APP_FRONT_CONTROLLER'] : 'index.php';

$_SERVER = array_merge($_SERVER, $_ENV);
$_SERVER['SCRIPT_FILENAME'] = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $script;
$_SERVER['SCRIPT_FILENAME'] = $_SERVER['DOCUMENT_ROOT'] . \DIRECTORY_SEPARATOR . $script;

// Since we are rewriting to app_dev.php, adjust SCRIPT_NAME and PHP_SELF accordingly
$_SERVER['SCRIPT_NAME'] = DIRECTORY_SEPARATOR . $script;
$_SERVER['PHP_SELF'] = DIRECTORY_SEPARATOR . $script;
$_SERVER['SCRIPT_NAME'] = \DIRECTORY_SEPARATOR . $script;
$_SERVER['PHP_SELF'] = \DIRECTORY_SEPARATOR . $script;

require $_SERVER['SCRIPT_FILENAME'];

Expand Down
2 changes: 1 addition & 1 deletion config/routes.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# Define website routes in `routes_admin.yaml` and admin routes in the `routes_website.yaml`
# Define website routes in `routes_website.yaml` and admin routes in the `routes_admin.yaml`
1 change: 0 additions & 1 deletion config/routes/sulu_article_admin.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Define your admin routes here
sulu_article_api:
resource: "@SuluArticleBundle/Resources/config/routing_api.yml"
type: rest
Expand Down
15 changes: 15 additions & 0 deletions config/routes_website.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,18 @@
#static:
# path: /static-route
# controller: App\Controller\DefaultController::index

# If you have a simple login on your website activate the following routes
# If you need registration or profile edit have a look at the:
# https://github.com/sulu/SuluCommunityBundle
#
#login:
# path: /login
# controller: Symfony\Bundle\FrameworkBundle\Controller\TemplateController
# defaults:
# # the following template need to be created:
# # see https://github.com/sulu/sulu/blob/2.x/templates/static/login.html.twig as example
# template: static/login.html.twig
#
#logout:
# path: /logout
10 changes: 0 additions & 10 deletions public/build/admin/main.1fc4d824c061757bb27a.css

This file was deleted.

10 changes: 10 additions & 0 deletions public/build/admin/main.4a194515da303556c9ec.css

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions public/build/admin/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"main.css": "build/admin/main.1fc4d824c061757bb27a.css",
"main.js": "build/admin/main.1fc4d824c061757bb27a.js",
"main.js.map": "build/admin/main.1fc4d824c061757bb27a.js.map",
"main.css": "build/admin/main.4a194515da303556c9ec.css",
"main.js": "build/admin/main.4a194515da303556c9ec.js",
"main.js.map": "build/admin/main.4a194515da303556c9ec.js.map",
"/build/admin/fonts/font-awesome.min.css": "/build/admin/fonts/fontawesome-webfont.f691f37e57f04c152e2315ab7dbad881.woff",
"/build/admin/fonts/global.scss": "/build/admin/fonts/open-sans-v15-latin-regular.ec806460121999bcfb12bc264d46d41e.woff2",
"/build/admin/fonts/sulu-icon.css": "/build/admin/fonts/sulu.7918956d252a916c3102478369c134b8.ttf",
Expand Down
6 changes: 3 additions & 3 deletions public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
Debug::enable();
}

if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {
Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {
Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO);
}

if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {
if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {
Request::setTrustedHosts([$trustedHosts]);
}

Expand Down
2 changes: 1 addition & 1 deletion public/maintenance.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}

// get language
$lang = mb_substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);

// chose locale
$locale = array_key_exists($lang, $translations) ? $lang : DEFAULT_LOCALE;
Expand Down
3 changes: 2 additions & 1 deletion public/robots.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# www.robotstxt.org/
# www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156449

# index nothing because content can be changed by anonymous users and is resetted regularly
User-agent: *
Disallow: /
Disallow: /
4 changes: 2 additions & 2 deletions src/DataFixtures/ORM/AppFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private function loadImages(ObjectManager $manager, CollectionInterface $collect
$finder = new Finder();

foreach ($finder->files()->in(__DIR__ . '/../images') as $file) {
$media[pathinfo($file, PATHINFO_BASENAME)] = $this->createMedia($manager, $collection, $file);
$media[pathinfo($file, \PATHINFO_BASENAME)] = $this->createMedia($manager, $collection, $file);
}

return $media;
Expand Down Expand Up @@ -682,6 +682,6 @@ private function createAnalytics(ObjectManager $manager, array $data): Analytics
*/
public function getOrder()
{
return PHP_INT_MAX;
return \PHP_INT_MAX;
}
}
16 changes: 8 additions & 8 deletions src/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,8 @@ class Kernel extends SuluKernel implements HttpCacheProvider
*/
private $httpCache;

public function __construct(string $environment, bool $debug, string $suluContext = self::CONTEXT_ADMIN)
{
parent::__construct($environment, $debug, $suluContext);
}

protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void
{
// Feel free to remove the "container.autowiring.strict_mode" parameter
// if you are using symfony/dependency-injection 4.0+ as it's the default behavior
$container->setParameter('container.autowiring.strict_mode', true);
$container->setParameter('container.dumper.inline_class_loader', true);

parent::configureContainer($container, $loader);
Expand All @@ -44,6 +36,14 @@ public function getHttpCache()
{
if (!$this->httpCache) {
$this->httpCache = new SuluHttpCache($this);
// Activate the following for user based caching see also:
// https://foshttpcachebundle.readthedocs.io/en/latest/features/user-context.html
//
//$this->httpCache->addSubscriber(
// new \FOS\HttpCache\SymfonyCache\UserContextListener([
// 'session_name_prefix' => 'SULUSESSID',
// ])
//);
}

return $this->httpCache;
Expand Down
3 changes: 3 additions & 0 deletions symfony.lock
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,9 @@
"phpcr/phpcr-utils": {
"version": "1.4.1"
},
"phpstan/phpdoc-parser": {
"version": "0.4.10"
},
"phpstan/phpstan": {
"version": "0.11.19"
},
Expand Down
9 changes: 8 additions & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
<?php

declare(strict_types=1);
/*
* This file is part of Sulu.
*
* (c) Sulu GmbH
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

use Symfony\Component\Dotenv\Dotenv;

Expand Down
1 change: 0 additions & 1 deletion tests/travis.php.ini

This file was deleted.

0 comments on commit 98453fc

Please sign in to comment.