Skip to content

Commit

Permalink
Upgrade to Ibexa 4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
emodric committed Apr 26, 2022
1 parent 20d1572 commit 09efe82
Show file tree
Hide file tree
Showing 26 changed files with 225 additions and 160 deletions.
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ APP_SECRET=ThisTokenIsNotSoSecretChangeIt
###< symfony/framework-bundle ###

###> symfony/mailer ###
# MAILER_DSN=smtp://localhost
# MAILER_DSN=null://null
###< symfony/mailer ###

###> doctrine/doctrine-bundle ###
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
#
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
# DATABASE_URL="mysql://db_user:[email protected]:3306/db_name?serverVersion=5.7"
# DATABASE_URL="mysql://db_user:[email protected]:3306/db_name?serverVersion=5.7&charset=utf8mb4"
DATABASE_URL="postgresql://symfony:[email protected]:5432/app?serverVersion=13&charset=utf8"
###< doctrine/doctrine-bundle ###

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"doctrine/doctrine-bundle": "^2.4.2",
"doctrine/doctrine-migrations-bundle": "^3.2",
"doctrine/orm": "^2.11",
"ibexa/oss": "~4.0.1",
"ibexa/oss": "~4.1.0",
"phpdocumentor/reflection-docblock": "^5.3",
"phpstan/phpdoc-parser": "^1.2",
"phpstan/phpdoc-parser": "^1.4",
"sensio/framework-extra-bundle": "^6.1",
"symfony/asset": "5.4.*",
"symfony/console": "5.4.*",
Expand Down
5 changes: 5 additions & 0 deletions config/packages/debug.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
when@dev:
debug:
# Forwards VarDumper Data clones to a centralized server allowing to inspect dumps on CLI or in your browser.
# See the "server:dump" command to start a new server.
dump_destination: "tcp://%env(VAR_DUMPER_SERVER)%"
4 changes: 0 additions & 4 deletions config/packages/dev/debug.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions config/packages/dev/mailer.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions config/packages/dev/monolog.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions config/packages/dev/web_profiler.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions config/packages/dev/webpack_encore.yaml

This file was deleted.

25 changes: 25 additions & 0 deletions config/packages/doctrine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,28 @@ doctrine:
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App

when@test:
doctrine:
dbal:
# "TEST_TOKEN" is typically set by ParaTest
dbname_suffix: '_test%env(default::TEST_TOKEN)%'

when@prod:
doctrine:
orm:
auto_generate_proxy_classes: false
query_cache_driver:
type: pool
pool: doctrine.system_cache_pool
result_cache_driver:
type: pool
pool: doctrine.result_cache_pool

framework:
cache:
pools:
doctrine.result_cache_pool:
adapter: cache.app
doctrine.system_cache_pool:
adapter: cache.system
61 changes: 61 additions & 0 deletions config/packages/monolog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
monolog:
channels:
- deprecation # Deprecations are logged in the dedicated "deprecation" channel when it exists

when@dev:
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: ["!event", "!doctrine"]
# uncomment to get logging in your browser
# you may have to allow bigger header sizes in your Web server configuration
#firephp:
# type: firephp
# level: info
#chromephp:
# type: chromephp
# level: info
console:
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine", "!console"]

when@test:
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
excluded_http_codes: [404, 405]
channels: ["!event"]
nested:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug

when@prod:
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
excluded_http_codes: [404, 405]
buffer_size: 50 # How many messages should be saved? Prevent memory leaks
nested:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
formatter: monolog.formatter.json
console:
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine"]
deprecation:
type: stream
channels: [deprecation]
path: "%kernel.logs_dir%/%kernel.environment%.deprecations.log"
8 changes: 0 additions & 8 deletions config/packages/prod/deprecations.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions config/packages/prod/doctrine.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions config/packages/prod/monolog.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions config/packages/prod/webpack_encore.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions config/packages/test/doctrine.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions config/packages/test/monolog.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions config/packages/test/validator.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions config/packages/test/web_profiler.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions config/packages/test/webpack_encore.yaml

This file was deleted.

5 changes: 5 additions & 0 deletions config/packages/validator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ framework:
# For instance, basic validation constraints will be inferred from Doctrine's metadata.
#auto_mapping:
# App\Entity\: []

when@test:
framework:
validation:
not_compromised_password: false
20 changes: 20 additions & 0 deletions config/packages/web_profiler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
when@dev:
web_profiler:
toolbar: true
intercept_redirects: false
# By default disable showing of Admin UI "notifications/count" in web debug toolbar AJAX calls list to make it more manageable.
excluded_ajax_paths: '(^/(app(_[\\w]+)?\\.php/)?_wdt)|/notifications/count'

framework:
profiler:
only_exceptions: false
# Optional: Skips generating profiles for subrequests by default due to dev performance
only_main_requests: true

when@test:
web_profiler:
toolbar: false
intercept_redirects: false

framework:
profiler: { collect: false }
16 changes: 16 additions & 0 deletions config/packages/webpack_encore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,19 @@ webpack_encore:
# Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes)
# Put in config/packages/prod/webpack_encore.yaml
# cache: true

when@dev:
webpack_encore:
builds:
# The path where Encore is building the assets - i.e. Encore.setOutputPath()
app: '%kernel.project_dir%/public/assets/app/build_dev'

when@prod:
webpack_encore:
builds:
# The path where Encore is building the assets - i.e. Encore.setOutputPath()
app: '%kernel.project_dir%/public/assets/app/build'

#when@test:
# webpack_encore:
# strict_mode: false
7 changes: 0 additions & 7 deletions config/routes/dev/web_profiler.yaml

This file was deleted.

8 changes: 8 additions & 0 deletions config/routes/web_profiler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
when@dev:
web_profiler_wdt:
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
prefix: /_wdt

web_profiler_profiler:
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
prefix: /_profiler
8 changes: 8 additions & 0 deletions ibexa.webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const bundles = require('./var/encore/ibexa.config.js');
const ibexaConfigManager = require('./ibexa.webpack.config.manager.js');
const configManagers = require('./var/encore/ibexa.config.manager.js');
const configSetups = require('./var/encore/ibexa.config.setup.js');
const path = require('path');

module.exports = (Encore) => {
Encore.setOutputPath('public/assets/ibexa/build')
Expand All @@ -17,6 +19,12 @@ module.exports = (Encore) => {
.enableReactPreset()
.enableSingleRuntimeChunk();

configSetups.forEach((configSetupPath) => {
const setupConfig = require(configSetupPath);

setupConfig(Encore);
});

bundles.forEach((configPath) => {
const addEntries = require(configPath);

Expand Down
Loading

0 comments on commit 09efe82

Please sign in to comment.