Skip to content

Commit aba61e9

Browse files
authored
IBX-8534: Dropped core deprecations (#435)
For more details see https://issues.ibexa.co/browse/IBX-8534 and #435 Key changes: * Dropped deprecated view providers * Dropped `pagelayout` * Dropped MetadataHandler * Dropped overriding session attribute bag storage key * Dropped deprecated imagemagick configuration * Dropped usage of deprecated properties * Dropped mimetype property * Redone SimplifiedRequest constructor * Dropped ContentCacheClearEvent * Dropped getExternalPath & getInternalPath * Dropped convertToEz * Dropped PreviewLocationProvider::loadMainLocation * Dropped deprecated configuration from Common * Dropped deprecated ezplatform global * Dropped deprecated Regex Matchers * Dropped RepositoryPolicyProvider * Fixed SimplfiedRequest constructor * Fixed SimplifiedRequest tests - unified port being int instead of string * Dropped \Ibexa\Bundle\Core\Imagine\VariationPathGenerator * Dropped \Ibexa\Bundle\Debug\Collector\PersistenceCacheCollector::getCount * Dropped Installer:createConfiguration * Dropped \Ibexa\Contracts\Core\FieldType\BinaryBase\PathGenerator * Dropped emitting deprecated pre and after user update password events * Dropped $context from \Ibexa\Contracts\Core\FieldType\FieldStorage methods * Dropped \Ibexa\Core\FieldType\GatewayBasedStorage * Dropped \Ibexa\Core\Repository\PermissionsCriterionHandler * Dropped \Ibexa\Contracts\Core\IO\BinaryFile::$mimeType * Dropped ContentService::loadContentDraftList * Dropped ContentService::loadRelations * Dropped addGateway from tests, as it no longer exists
1 parent 78236ff commit aba61e9

File tree

124 files changed

+462
-3948
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+462
-3948
lines changed

phpstan-baseline.neon

Lines changed: 1 addition & 881 deletions
Large diffs are not rendered by default.

src/bundle/Core/DependencyInjection/Configuration/Parser/Common.php

Lines changed: 2 additions & 153 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,13 @@
99

1010
use Ibexa\Bundle\Core\DependencyInjection\Configuration\AbstractParser;
1111
use Ibexa\Bundle\Core\DependencyInjection\Configuration\SiteAccessAware\ContextualizerInterface;
12-
use Ibexa\Bundle\Core\DependencyInjection\Configuration\Suggestion\Collector\SuggestionCollectorAwareInterface;
13-
use Ibexa\Bundle\Core\DependencyInjection\Configuration\Suggestion\Collector\SuggestionCollectorInterface;
14-
use Ibexa\Bundle\Core\DependencyInjection\Configuration\Suggestion\ConfigSuggestion;
1512
use Symfony\Component\Config\Definition\Builder\NodeBuilder;
1613

1714
/**
1815
* Configuration parser handling all basic configuration (aka "common").
1916
*/
20-
class Common extends AbstractParser implements SuggestionCollectorAwareInterface
17+
class Common extends AbstractParser
2118
{
22-
/** @var \Ibexa\Bundle\Core\DependencyInjection\Configuration\Suggestion\Collector\SuggestionCollectorInterface */
23-
private $suggestionCollector;
24-
2519
/**
2620
* Adds semantic configuration definition.
2721
*
@@ -31,28 +25,6 @@ public function addSemanticConfig(NodeBuilder $nodeBuilder)
3125
{
3226
$nodeBuilder
3327
->scalarNode('repository')->info('The repository to use. Choose among ibexa.repositories.')->end()
34-
// @deprecated
35-
// Use ibexa.repositories / repository settings instead.
36-
->arrayNode('database')
37-
->info('DEPRECATED. Use ibexa.repositories / repository settings instead.')
38-
->children()
39-
->enumNode('type')->values(['mysql', 'pgsql', 'sqlite'])->info('The database driver. Can be mysql, pgsql or sqlite.')->end()
40-
->scalarNode('server')->end()
41-
->scalarNode('port')->end()
42-
->scalarNode('user')->cannotBeEmpty()->end()
43-
->scalarNode('password')->end()
44-
->scalarNode('database_name')->cannotBeEmpty()->end()
45-
->scalarNode('charset')->defaultValue('utf8')->end()
46-
->scalarNode('socket')->end()
47-
->arrayNode('options')
48-
->info('Arbitrary options, supported by your DB driver ("driver-opts" in PDO)')
49-
->example(['foo' => 'bar', 'someOptionName' => ['one', 'two', 'three']])
50-
->useAttributeAsKey('key')
51-
->prototype('variable')->end()
52-
->end()
53-
->scalarNode('dsn')->info('Full database DSN. Will replace settings above.')->example('mysql://root:root@localhost:3306/ezdemo')->end()
54-
->end()
55-
->end()
5628
->scalarNode('cache_service_name')
5729
->example('cache.app')
5830
->info('The cache pool service name to use for a siteaccess / siteaccess-group, *must* be present.')
@@ -64,13 +36,7 @@ public function addSemanticConfig(NodeBuilder $nodeBuilder)
6436
->end()
6537
->arrayNode('api_keys')
6638
->info('Collection of API keys')
67-
->addDefaultsIfNotSet()
68-
->children()
69-
->scalarNode('google_maps')
70-
->setDeprecated('The child node "%node%" at path "%path%" is no longer used and deprecated.')
71-
->info('Google Maps API Key, required as of Google Maps v3 to make sure maps show up correctly.')
72-
->end()
73-
->end()
39+
->scalarPrototype()->end()
7440
->end()
7541
->scalarNode('storage_dir')
7642
->cannotBeEmpty()
@@ -80,10 +46,6 @@ public function addSemanticConfig(NodeBuilder $nodeBuilder)
8046
->cannotBeEmpty()
8147
->info('Directory where binary files (from ezbinaryfile field type) are stored. Default value is "original"')
8248
->end()
83-
// @deprecated since 5.3. Will be removed in 6.x.
84-
->scalarNode('session_name')
85-
->info('DEPRECATED. Use session.name instead.')
86-
->end()
8749
->arrayNode('session')
8850
->info('Session options. Will override options defined in Symfony framework.session.*')
8951
->children()
@@ -98,11 +60,6 @@ public function addSemanticConfig(NodeBuilder $nodeBuilder)
9860
->booleanNode('cookie_httponly')->end()
9961
->end()
10062
->end()
101-
->scalarNode('pagelayout')
102-
->info('The default layout to use')
103-
->example('AppBundle::pagelayout.html.twig')
104-
->setDeprecated('The "pagelayout" option is deprecated. Use "page_layout" instead.')
105-
->end()
10663
->scalarNode('page_layout')
10764
->info('The default layout to use')
10865
->example('AppBundle::page_layout.html.twig')
@@ -152,9 +109,6 @@ public function preMap(array $config, ContextualizerInterface $contextualizer)
152109

153110
public function mapConfig(array &$scopeSettings, $currentScope, ContextualizerInterface $contextualizer)
154111
{
155-
if (isset($scopeSettings['database'])) {
156-
$this->addDatabaseConfigSuggestion($currentScope, $scopeSettings['database']);
157-
}
158112
if (isset($scopeSettings['repository'])) {
159113
$contextualizer->setContextualParameter('repository', $currentScope, $scopeSettings['repository']);
160114
}
@@ -176,19 +130,6 @@ public function mapConfig(array &$scopeSettings, $currentScope, ContextualizerIn
176130
$contextualizer->setContextualParameter('api_keys.' . $key, $currentScope, $value);
177131
}
178132

179-
// session_name setting is deprecated in favor of session.name
180-
$container = $contextualizer->getContainer();
181-
$sessionOptions = $container->hasParameter("ibexa.site_access.config.$currentScope.session") ? $container->getParameter("ibexa.site_access.config.$currentScope.session") : [];
182-
if (isset($sessionOptions['name'])) {
183-
$contextualizer->setContextualParameter('session_name', $currentScope, $sessionOptions['name']);
184-
}
185-
// @deprecated session_name is deprecated, but if present, in addition to session.name, consider it instead (BC).
186-
if (isset($scopeSettings['session_name'])) {
187-
$sessionOptions['name'] = $scopeSettings['session_name'];
188-
$contextualizer->setContextualParameter('session_name', $currentScope, $scopeSettings['session_name']);
189-
$contextualizer->setContextualParameter('session', $currentScope, $sessionOptions);
190-
}
191-
192133
if (isset($scopeSettings['http_cache']['purge_servers'])) {
193134
$contextualizer->setContextualParameter('http_cache.purge_servers', $currentScope, $scopeSettings['http_cache']['purge_servers']);
194135
}
@@ -207,100 +148,8 @@ public function mapConfig(array &$scopeSettings, $currentScope, ContextualizerIn
207148
if (isset($scopeSettings['default_page'])) {
208149
$contextualizer->setContextualParameter('default_page', $currentScope, '/' . ltrim($scopeSettings['default_page'], '/'));
209150
}
210-
if (isset($scopeSettings['pagelayout'])) {
211-
// note: "pagelayout" is deprecated, deprecation message is set via Semantic Config Node Builder
212-
$contextualizer->setContextualParameter('pagelayout', $currentScope, $scopeSettings['pagelayout']);
213-
$contextualizer->setContextualParameter('page_layout', $currentScope, $scopeSettings['pagelayout']);
214-
}
215151
if (isset($scopeSettings['page_layout'])) {
216-
// note: "page_layout" as the new setting always takes precedence
217-
$contextualizer->setContextualParameter('pagelayout', $currentScope, $scopeSettings['page_layout']);
218152
$contextualizer->setContextualParameter('page_layout', $currentScope, $scopeSettings['page_layout']);
219153
}
220154
}
221-
222-
/**
223-
* Injects SuggestionCollector.
224-
*
225-
* @param \Ibexa\Bundle\Core\DependencyInjection\Configuration\Suggestion\Collector\SuggestionCollectorInterface $suggestionCollector
226-
*/
227-
public function setSuggestionCollector(SuggestionCollectorInterface $suggestionCollector)
228-
{
229-
$this->suggestionCollector = $suggestionCollector;
230-
}
231-
232-
private function addDatabaseConfigSuggestion($sa, array $databaseConfig)
233-
{
234-
$suggestion = new ConfigSuggestion(
235-
<<<EOT
236-
Database configuration has changed for Ibexa Content repository.
237-
Please define:
238-
- An entry in ibexa.repositories
239-
- A Doctrine connection (You may check configuration reference for Doctrine "config:dump-reference doctrine" console command.)
240-
- A reference to configured repository in ibexa.system.$sa.repository
241-
EOT
242-
);
243-
$suggestion->setMandatory(true);
244-
$suggestionArray = [
245-
'driver' => 'pdo_mysql',
246-
'host' => 'localhost',
247-
'dbname' => 'my_database',
248-
'user' => 'my_user',
249-
'password' => 'some_password',
250-
'charset' => 'UTF8',
251-
];
252-
253-
if (!empty($databaseConfig)) {
254-
$suggestionArray['dbname'] = $databaseConfig['database_name'];
255-
$suggestionArray['host'] = $databaseConfig['server'];
256-
$driverMap = [
257-
'mysql' => 'pdo_mysql',
258-
'pgsql' => 'pdo_pgsql',
259-
'sqlite' => 'pdo_sqlite',
260-
];
261-
if (isset($driverMap[$databaseConfig['type']])) {
262-
$suggestionArray['driver'] = $driverMap[$databaseConfig['type']];
263-
} else {
264-
$suggestionArray['driver'] = $databaseConfig['type'];
265-
}
266-
if (isset($databaseConfig['socket'])) {
267-
$suggestionArray['unix_socket'] = $databaseConfig['socket'];
268-
}
269-
$suggestionArray['options'] = $databaseConfig['options'];
270-
$suggestionArray['user'] = $databaseConfig['user'];
271-
$suggestionArray['password'] = $databaseConfig['password'];
272-
}
273-
$suggestion->setSuggestion(
274-
[
275-
'doctrine' => [
276-
'dbal' => [
277-
'connections' => [
278-
'default' => $suggestionArray,
279-
],
280-
],
281-
],
282-
'ibexa' => [
283-
'repositories' => [
284-
'my_repository' => [
285-
'storage' => [
286-
'engine' => 'legacy',
287-
'connection' => 'default',
288-
],
289-
'search' => [
290-
'engine' => 'legacy',
291-
'connection' => 'default',
292-
],
293-
],
294-
],
295-
'system' => [
296-
$sa => [
297-
'repository' => 'my_repository',
298-
],
299-
],
300-
],
301-
]
302-
);
303-
304-
$this->suggestionCollector->addSuggestion($suggestion);
305-
}
306155
}

src/bundle/Core/DependencyInjection/Configuration/Parser/Image.php

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,13 @@
99

1010
use Ibexa\Bundle\Core\DependencyInjection\Configuration\AbstractParser;
1111
use Ibexa\Bundle\Core\DependencyInjection\Configuration\SiteAccessAware\ContextualizerInterface;
12-
use Ibexa\Bundle\Core\DependencyInjection\Configuration\Suggestion\Collector\SuggestionCollectorAwareInterface;
13-
use Ibexa\Bundle\Core\DependencyInjection\Configuration\Suggestion\Collector\SuggestionCollectorInterface;
14-
use Ibexa\Bundle\Core\DependencyInjection\Configuration\Suggestion\ConfigSuggestion;
1512
use Symfony\Component\Config\Definition\Builder\NodeBuilder;
1613

1714
/**
1815
* Configuration parser handling all basic configuration (aka "Image").
1916
*/
20-
class Image extends AbstractParser implements SuggestionCollectorAwareInterface
17+
class Image extends AbstractParser
2118
{
22-
/** @var \Ibexa\Bundle\Core\DependencyInjection\Configuration\Suggestion\Collector\SuggestionCollectorInterface */
23-
private $suggestionCollector;
24-
25-
public function setSuggestionCollector(SuggestionCollectorInterface $suggestionCollector)
26-
{
27-
$this->suggestionCollector = $suggestionCollector;
28-
}
29-
3019
/**
3120
* Adds semantic configuration definition.
3221
*
@@ -35,13 +24,6 @@ public function setSuggestionCollector(SuggestionCollectorInterface $suggestionC
3524
public function addSemanticConfig(NodeBuilder $nodeBuilder)
3625
{
3726
$nodeBuilder
38-
->arrayNode('imagemagick')
39-
->info('DEPRECATED.')
40-
->children()
41-
->scalarNode('pre_parameters')->info('Parameters that must be run BEFORE the filenames and filters')->end()
42-
->scalarNode('post_parameters')->info('Parameters that must be run AFTER the filenames and filters')->end()
43-
->end()
44-
->end()
4527
->arrayNode('image_variations')
4628
->info('Configuration for your image variations (aka "image aliases")')
4729
->example(
@@ -119,7 +101,7 @@ static function ($v) {
119101
->end()
120102
->scalarNode('image_host')
121103
->info('Images host. All system images URLs are prefixed with given host if configured.')
122-
->example('https://ezplatform.com')
104+
->example('https://ibexa.co')
123105
->end();
124106
}
125107

@@ -132,11 +114,5 @@ public function preMap(array $config, ContextualizerInterface $contextualizer)
132114

133115
public function mapConfig(array &$scopeSettings, $currentScope, ContextualizerInterface $contextualizer)
134116
{
135-
if (isset($scopeSettings['imagemagick'])) {
136-
$suggestion = new ConfigSuggestion(
137-
'"imagemagick" settings are deprecated. Just remove them from your configuration file.'
138-
);
139-
$this->suggestionCollector->addSuggestion($suggestion);
140-
}
141117
}
142118
}

src/bundle/Core/DependencyInjection/IbexaCoreExtension.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ public function load(array $configs, ContainerBuilder $container)
130130

131131
$this->registerRepositoriesConfiguration($config, $container);
132132
$this->registerSiteAccessConfiguration($config, $container);
133-
$this->registerImageMagickConfiguration($config, $container);
134133
$this->registerUrlAliasConfiguration($config, $container);
135134
$this->registerUrlWildcardsConfiguration($config, $container);
136135
$this->registerOrmConfiguration($config, $container);
@@ -299,21 +298,6 @@ private function registerSiteAccessConfiguration(array $config, ContainerBuilder
299298
ConfigurationProcessor::setGroupsBySiteAccess($groupsBySiteaccess);
300299
}
301300

302-
private function registerImageMagickConfiguration(array $config, ContainerBuilder $container)
303-
{
304-
if (isset($config['imagemagick'])) {
305-
$container->setParameter('ibexa.image.imagemagick.enabled', $config['imagemagick']['enabled']);
306-
if ($config['imagemagick']['enabled']) {
307-
$container->setParameter('ibexa.image.imagemagick.executable_path', dirname($config['imagemagick']['path']));
308-
$container->setParameter('ibexa.image.imagemagick.executable', basename($config['imagemagick']['path']));
309-
}
310-
}
311-
312-
$filters = isset($config['imagemagick']['filters']) ? $config['imagemagick']['filters'] : [];
313-
$filters = $filters + $container->getParameter('ibexa.image.imagemagick.filters');
314-
$container->setParameter('ibexa.image.imagemagick.filters', $filters);
315-
}
316-
317301
private function registerOrmConfiguration(array $config, ContainerBuilder $container): void
318302
{
319303
if (!isset($config['orm']['entity_mappings'])) {

src/bundle/Core/DependencyInjection/Security/PolicyProvider/RepositoryPolicyProvider.php

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/bundle/Core/Imagine/VariationPathGenerator.php

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)