Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c2cdbfa
start to replace our custom parameters with real symfony config
craigh Aug 3, 2020
8ec71ca
more parameter replacement
craigh Aug 3, 2020
95ad67a
varname correction
craigh Aug 3, 2020
01149dd
inject installed value
craigh Aug 3, 2020
17434f6
move metadata translation to service
craigh Aug 3, 2020
879ce87
cs
craigh Aug 3, 2020
83f07b7
make MetaDataTranslatorHelper public
craigh Aug 4, 2020
d2ae1c3
another try
craigh Aug 4, 2020
7c447a9
set the translator always. change helper to indicate that it is chang…
craigh Aug 5, 2020
5039d26
correct classname
craigh Aug 5, 2020
2257921
add config for datadir. remove unneeded sitedefinition aliases and de…
craigh Aug 6, 2020
09f35e3
does this work?
craigh Aug 6, 2020
8631167
Revert "does this work?"
craigh Aug 6, 2020
084eedb
set datadir
craigh Aug 6, 2020
d3014b1
use a constant for better edit-ability in the future.
craigh Aug 6, 2020
4abced6
add Configurator to load and write config files
craigh Aug 10, 2020
95b47dc
better theme config definitions
craigh Aug 10, 2020
1c07912
handling for session config
craigh Aug 10, 2020
aa94221
cs
craigh Aug 10, 2020
0ceeb96
handle jms_i18n_routing config
craigh Aug 13, 2020
f16529a
handle router context and assets_version
craigh Aug 13, 2020
751fb5b
update .env.test
craigh Aug 13, 2020
7a1c8e4
handle locale/translation params/config
craigh Aug 13, 2020
1b8ef13
correct test
craigh Aug 13, 2020
1940905
temporarily keep parameters key
craigh Aug 13, 2020
43b811c
big commit to remove services_custom.yaml, dynamic/generated.yaml and…
craigh Aug 16, 2020
ee72081
minor cs
craigh Aug 16, 2020
635fb35
remove uneeded command
craigh Aug 16, 2020
94ceda6
alter check for key
craigh Aug 16, 2020
336cc0b
remove some unused code
craigh Aug 16, 2020
6c5a2dc
remove unneeded comment
craigh Aug 16, 2020
6ae5a56
update changelog and some docs
craigh Aug 16, 2020
fcd7067
edit changelog
craigh Aug 16, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
APP_ENV=prod
APP_DEBUG=0
APP_SECRET=%generate(secret)%
DEFAULT_URI=https://localhost
#TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
#TRUSTED_HOSTS='^(localhost|example\\.com)$
###< symfony/framework-bundle ###
Expand Down
1 change: 1 addition & 0 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ KERNEL_CLASS=Kernel
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER='disabled=1'
PANTHER_APP_ENV=panther
DEFAULT_URI=https://localhost
DATABASE_URL='mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7'
ZIKULA_INSTALLED='3.0.0'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
!/bin/console
/config/*_custom.yaml
/config/dynamic/*
/config/packages/core.yaml
/config/packages/zikula*.yaml
!/config/dynamic/default.yaml
/.env.local
/.env.local.php
Expand Down
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ before_install:

- php bin/simple-phpunit

# update translation configurations to update core directories
- php bin/console zikula:translation:updateconfig
- php bin/console cache:clear
# extract en translations
- php bin/console translation:extract zikula en -vvv

Expand Down
12 changes: 10 additions & 2 deletions CHANGELOG-3.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@
## 3.1.0 (unreleased)

- BC Breaks:
- _there should be none_
- [CoreBundle] Removed `Zikula\Bundle\CoreBundle\DynamicConfigDumper`.
- [config] Removed `config/dynamic/*.yaml` files (use standard package config files).
- [config] Removed `config/services_custom.yaml` (use `services.yaml`).

- Fixes:
- _first fix_

- Features:
- Add StaticContent module to manage all static content (#4369).
- [CoreBundle] Add `Zikula\Bundle\CoreBundle\Configurator` for writing config files to the filesystem (#4433).
- [extensions] Add StaticContent module to manage all static content (#4369).
- [config] Added standard Symfony bundle configurations for the following bundles (#4433):
- [CoreBundle, ZikulaRoutesModule, ZikulaSecurityCenterModule, ZikulaSettingsModule, ZikulaThemeModule]

- Deprecated:
- [CoreBundle] `Zikula/CoreBundle/YamlDumper` (use `Configurator` as needed).
35 changes: 0 additions & 35 deletions config/dynamic/default.yaml

This file was deleted.

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

This file was deleted.

11 changes: 1 addition & 10 deletions config/packages/framework.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,7 @@ framework:
assets:
#base_path: '%router.request_context.base_url%'
base_path: ''
version: '%assets_version%'

session:
name: '%zikula.session.name%'
handler_id: '%zikula.session.handler_id%'
storage_id: '%zikula.session.storage_id%'
save_path: '%zikula.session.save_path%'
cookie_httponly: true
cookie_secure: auto
cookie_samesite: lax
version: ~

#esi: true
#fragments: true
Expand Down
2 changes: 0 additions & 2 deletions config/packages/jms_i18n_routing.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
jms_i18n_routing:
default_locale: '%locale%'
locales: '%localisation.locales%'
cookie:
enabled: false
5 changes: 0 additions & 5 deletions config/packages/php_translation.yaml

This file was deleted.

6 changes: 1 addition & 5 deletions config/packages/routing.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
framework:
router:
utf8: true

# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
#default_uri: https://localhost
# Note: for Zikula this is typically defined in /config/services_custom.yml
default_uri: '%env(DEFAULT_URI)%'
2 changes: 0 additions & 2 deletions config/packages/translation.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
framework:
#default_locale: en
default_locale: '%locale%'
translator:
default_path: '%kernel.project_dir%/translations'
fallbacks:
Expand Down
24 changes: 0 additions & 24 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,13 @@
# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
installed: '%env(ZIKULA_INSTALLED)%'
script_position: foot
# script_position defines the location where javascripts will be placed in the page
# choices are `head` or `foot`
datadir: public/uploads
locale: en

assets_version: ~ #e.g. 'v1'
zikula_asset_manager.combine: true
zikula_asset_manager.lifetime: "1 day"
zikula_asset_manager.compress: true
zikula_asset_manager.minify: true

# the following parameter is used in the clickjacking protection listener
# it accepts any values allowed for X-Frame-Options
security.x_frame_options: SAMEORIGIN

# all paths below are resolved as assets (in /public)
# stylesheet and javascript component locations
zikula.javascript.bootstrap.min.path: '/bootstrap/js/bootstrap.bundle.min.js'
zikula.stylesheet.bootstrap.min.path: '/bootstrap/css/bootstrap.min.css'
zikula.stylesheet.fontawesome.min.path: '/font-awesome/css/all.min.css'

services:
# default configuration for services in *this* file
_defaults:
autowire: true # Automatically injects dependencies in your services.
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.

zikula.site_definition: '@Zikula\Bundle\CoreBundle\Site\SiteDefinition'

# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
#App\:
Expand Down
38 changes: 0 additions & 38 deletions docs/Configuration/Settings/Dev/DynamicConfigDumper.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/Configuration/Settings/Dev/SiteDefinition.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ A default implementation is provided by `\Zikula\Bundle\CoreBundle\Site\SiteDefi

You can subclass this and tell the dependency injection system that it should use your custom subclass whenever the interface is expected.

For this add something like the following to `/config/services_custom.yaml`:
For this add something like the following to `/config/services.yaml`:

```yaml
services:
zikula.site_definition: '@Acme\FooTheme\Site\AcmeCustomSiteDefinition'
Zikula\Bundle\CoreBundle\Site\SiteDefinitionInterface: '@Acme\FooTheme\Site\AcmeCustomSiteDefinition'
```
1 change: 0 additions & 1 deletion docs/Configuration/Settings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@ TBD
## For developers

- [Site definition](Dev/SiteDefinition.md)
- [Dynamic configuration dumper](Dev/DynamicConfigDumper.md)
19 changes: 11 additions & 8 deletions docs/LayoutDesign/Templating/AssetCombination.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ Zikula Core provides functionality to combine both CSS and JavScript files into
which can improve performance of your website. Additionally, one can further minify the css files and also compress the
response to even further improve performance.

To enable the features, modify these parameters in the `/config/services_custom.yaml` file:
To enable the features, modify these values in the `/config/packages/zikula_theme.yaml` file
(create the file if needed):

| parameter | possible values
| ----------------------------- | --------------------------------
| zikula_asset_manager.combine | `true` or `false` (enables combination)
| zikula_asset_manager.lifetime | string like `"1 day"` or `"1 hour"`
| zikula_asset_manager.compress | `true` or `false`
| zikula_asset_manager.minify | `true` or `false`
```yaml
zikula_theme:
asset_manager:
combine: true # bool
lifetime: '1 day' # string like '1 day' or '1 hour'
compress: true # bool
minify: true # bool
```

If `zikula_asset_manager.combine` is false, none of the other parameters have any effect.
If `asset_manager.combine` is false, none of the other parameters have any effect.

Please note: Asset combination only occurs in the `prod` environment. If `env` is set to another value, it is disabled.
16 changes: 10 additions & 6 deletions docs/LayoutDesign/Themes/CustomBSandFA.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,24 @@ bootstrapPath: '@AcmeFooTheme:css/bootstrap.min.css'
## Full site

A **site administrator** can force the core to use a customized assets setting parameter values
in `/config/services_custom.yaml`:
Modify these values in the `/config/packages/zikula_theme.yaml` file (create the file if needed):

```yaml
zikula.javascript.bootstrap.min.path: '@AcmeFooModule:js/bootstrap.min.js'
zikula.stylesheet.bootstrap.min.path: '@AcmeFooModule:css/bootstrap.min.css'
zikula.stylesheet.fontawesome.min.path: '@AcmeFooModule:css/font-awesome.min.css'
zikula_theme:
bootstrap:
css_path: '/bootstrap/css/bootstrap.min.css'
js_path: '/bootstrap/js/bootstrap.bundle.min.js'
font_awesome_path: '/font-awesome/css/all.min.css'
```

Note these resolve to `public/` subfolders (see [Locations of Templates and Assets](../Templating/TemplateAndAssetLocations.md)).

Instead of putting it into an extension you can also have it inside `public` directly:

```yaml
zikula.stylesheet.bootstrap.min.path: /custom-bootstrap.min.css
zikula_theme:
bootstrap:
css_path: /custom-bootstrap.min.css
```

**Warning:** setting the value in `/config/services_custom.yaml` will affect *every* theme on the site.
**Warning:** setting these values will affect *every* theme on the site.
1 change: 1 addition & 0 deletions docs/Setup/Upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ All the dependencies and requirements are included in this package.
- Copy old files to _new_ locations:
- Copy your previous installation's `/app/config/custom_parameters.yml` to `/config/services_custom.yaml` in your new installation.
- note the name change and the suffix changed from `.yml` to `.yaml`
- When the upgrade to 3.1.0 is complete, the file will be deleted because the values are moved to config files.
- Copy your _compatible_ custom theme to the `src/extensions` directory (There is no `/themes` directory any longer).
- After upgrade, the site will default to the ZikulaBootstrapTheme until you complete testing of your custom theme.
- Return _compatible_ modules (extensions) to the `src/extensions` directory.
Expand Down
1 change: 1 addition & 0 deletions docs/Setup/UpgradeFrom3to3.x.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ All the dependencies and requirements are included in this package.
- Copy old files to parallel locations:
- Copy your previous installation's `/.env.local` to `/.env.local` in your new installation.
- Copy your previous installation's `/config/services_custom.yaml` to `/config/services_custom.yaml` in your new installation.
- When the upgrade to 3.1.0 is complete, the file will be deleted because the values are moved to config files.
- Copy your custom theme to the `src/extensions` directory.
- After upgrade, the site will default to the ZikulaBootstrapTheme until you complete testing of your custom theme.
- Copy extensions to the `src/extensions` directory.
Expand Down
9 changes: 9 additions & 0 deletions docs/config_defaults/core.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# These are the default values
core:
datadir: public/uploads
maker_root_namespace: null
multisites:
enabled: false
mainsiteurl: null
based_on_domains: null
protected_systemvars: []
3 changes: 3 additions & 0 deletions docs/config_defaults/zikula_routes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are the default values
zikula_routes:
jms_i18n_routing_strategy: prefix_except_default
9 changes: 9 additions & 0 deletions docs/config_defaults/zikula_security_center.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# These are the default values
zikula_security_center:
x_frame_options: SAMEORIGIN
session:
name: _zsid
handler_id: session.handler.native_file
storage_id: zikula_core.bridge.http_foundation.zikula_session_storage_file
save_path: '%kernel.cache_dir%/sessions'
cookie_secure: auto
5 changes: 5 additions & 0 deletions docs/config_defaults/zikula_settings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# These are the default values
zikula_settings:
locale: en
locales:
- en
12 changes: 12 additions & 0 deletions docs/config_defaults/zikula_theme.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are the default values
zikula_theme:
script_position: foot
bootstrap:
css_path: '/bootstrap/css/bootstrap.min.css'
js_path: '/bootstrap/js/bootstrap.bundle.min.js'
font_awesome_path: '/font-awesome/css/all.min.css'
asset_manager:
combine: false
lifetime: '1 day'
compress: true
minify: true
16 changes: 0 additions & 16 deletions src/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
use Zikula\Bundle\CoreBundle\DynamicConfigDumper;
use Zikula\Bundle\CoreBundle\Helper\PersistedBundleHelper;
use Zikula\Bundle\CoreBundle\HttpKernel\ZikulaKernel;

Expand Down Expand Up @@ -66,21 +65,6 @@ protected function configureContainer(ContainerConfigurator $container, LoaderIn
} elseif (is_file($path = $configDir . 'services.php')) {
(require $path)($container->withPath($path), $this);
}

if (is_file($configDir . 'services_custom.yaml')) {
$loader->load($configDir . 'services_custom.yaml');
}

if (!is_file($configDir . DynamicConfigDumper::CONFIG_GENERATED)) {
// There is no generated configuration (yet), load default values.
// This only happens at the very first time Symfony is started.
$loader->load($configDir . DynamicConfigDumper::CONFIG_DEFAULT);
} else {
$loader->load($configDir . DynamicConfigDumper::CONFIG_GENERATED);
if (is_file($configDir . 'dynamic/generated_' . $this->environment . '.yaml')) {
$loader->load($configDir . 'dynamic/generated_' . $this->environment . '.yaml');
}
}
}

protected function configureRoutes(RoutingConfigurator $routes): void
Expand Down
Loading