Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-8534: Dropped core deprecations - batch 1 #435

Merged
merged 55 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
9825ea3
IBX-8534: Dropped deprecated view providers
ViniTou Sep 9, 2024
5047f47
IBX-8534: Dropped `pagelayout`
ViniTou Sep 9, 2024
0593576
IBX-8534: Dropped MetadataHandler
ViniTou Sep 10, 2024
1282c84
Dropped overriding session attribute bag storage key
ViniTou Sep 10, 2024
e7fa56e
Dropped deprecated imagemagick configuration
ViniTou Sep 10, 2024
77b0fc4
Dropped usage of deprecated properties
ViniTou Sep 11, 2024
3d07afc
dropped mimetype property
ViniTou Sep 12, 2024
feb9cad
Redone SimplifiedRequest constructor
ViniTou Sep 12, 2024
ecfd524
dropped ContentCacheClearEvent
ViniTou Sep 12, 2024
02b7b0b
dropped getExternalPath & getInternalPath
ViniTou Sep 13, 2024
d9a9c32
dropped convertToEz
ViniTou Sep 13, 2024
b285d7b
dropped PreviewLocationProvider::loadMainLocation
ViniTou Sep 13, 2024
bffc938
dropped deprecated configuration from Common
ViniTou Sep 13, 2024
12fd9c7
dropped deprecated ezplatform global
ViniTou Sep 16, 2024
95e7f62
Dropped deprecated Regex Matchers
ViniTou Sep 16, 2024
f625f91
dropped RepositoryPolicyProvider
ViniTou Sep 16, 2024
496fceb
fixed SimplfiedRequest constructor
ViniTou Sep 19, 2024
ad4338e
Fixed SimplifiedRequest tests - unified port being int instead of string
ViniTou Sep 20, 2024
4ea6b16
dropped \Ibexa\Bundle\Core\Imagine\VariationPathGenerator
ViniTou Sep 16, 2024
10d4ae1
dropped \Ibexa\Bundle\Debug\Collector\PersistenceCacheCollector::getC…
ViniTou Sep 17, 2024
a329049
dropped Installer:createConfiguration
ViniTou Sep 17, 2024
a6af078
dropped \Ibexa\Contracts\Core\FieldType\BinaryBase\PathGenerator
ViniTou Sep 17, 2024
6f1579a
dropped emitting deprecated pre and after user update password events
ViniTou Sep 17, 2024
f44211c
dropped $context from \Ibexa\Contracts\Core\FieldType\FieldStorage me…
ViniTou Sep 17, 2024
7f772c3
dropped \Ibexa\Core\FieldType\GatewayBasedStorage
ViniTou Sep 18, 2024
f54d20b
dropped \Ibexa\Core\Repository\PermissionsCriterionHandler
ViniTou Sep 18, 2024
7e31736
dropped \Ibexa\Contracts\Core\IO\BinaryFile::$mimeType
ViniTou Sep 18, 2024
19ddc09
dropped ContentService::loadContentDraftList
ViniTou Sep 18, 2024
8305164
dropped ContentService::loadRelations
ViniTou Sep 19, 2024
f251f47
dropped addGateway from tests, as it no longer exists
ViniTou Sep 19, 2024
209e830
loadBinaryFileByUri no longer expects $id, it works on $internalId
ViniTou Sep 19, 2024
38bacc1
loadMainLocationByContent does no call loadContent anymore
ViniTou Sep 19, 2024
8bd66b7
Replaced mimetype property call with hardcoded type
ViniTou Sep 19, 2024
ee424ef
dropped tests for removed class
ViniTou Sep 19, 2024
11bb254
dropped removed serializers from tests
ViniTou Sep 19, 2024
2cd538d
Dropped tests for no longer existing contentView methods
ViniTou Sep 20, 2024
6668624
dropped database common semantic configuration
ViniTou Sep 20, 2024
e510178
Fixed loadContentDraftList return value
ViniTou Sep 20, 2024
caae899
Dropped session_name related tests
ViniTou Sep 20, 2024
7ff429d
Changed api_keys configuration to accept configuration pairs of name:key
ViniTou Sep 20, 2024
261fb4e
Fixed return type of loadRelationList
ViniTou Sep 20, 2024
18c78b4
Adjust default values for properties to match those from valueObject
ViniTou Sep 20, 2024
4bbda27
dropped loadRelations from configured method as it no longer exists
ViniTou Sep 20, 2024
fdfedae
Fixed ViewManager autoconfigure
ViniTou Sep 20, 2024
ce22393
Added missing normalization
ViniTou Sep 20, 2024
bfc3572
Changed deprecation trigger condition
ViniTou Sep 20, 2024
336c021
fixed drafts related tests
ViniTou Sep 20, 2024
a280a31
code style
ViniTou Oct 10, 2024
0dfb73d
fixed minor phpstan issues
ViniTou Oct 10, 2024
bebe1a4
cleanup helpers.yml
ViniTou Oct 25, 2024
a49b84e
Fixes after rebase
ViniTou Nov 4, 2024
19f11de
Improved SimplifiedRequest constructor
ViniTou Nov 8, 2024
f8e7caf
Replaced all old constructor syntax calls for SimplifiedRequest
ViniTou Nov 8, 2024
39d9e3c
Regenerated phpstan baseline
ViniTou Nov 8, 2024
7b19750
Fixed unit test
ViniTou Nov 8, 2024
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
882 changes: 1 addition & 881 deletions phpstan-baseline.neon

Large diffs are not rendered by default.

155 changes: 2 additions & 153 deletions src/bundle/Core/DependencyInjection/Configuration/Parser/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,13 @@

use Ibexa\Bundle\Core\DependencyInjection\Configuration\AbstractParser;
use Ibexa\Bundle\Core\DependencyInjection\Configuration\SiteAccessAware\ContextualizerInterface;
use Ibexa\Bundle\Core\DependencyInjection\Configuration\Suggestion\Collector\SuggestionCollectorAwareInterface;
use Ibexa\Bundle\Core\DependencyInjection\Configuration\Suggestion\Collector\SuggestionCollectorInterface;
use Ibexa\Bundle\Core\DependencyInjection\Configuration\Suggestion\ConfigSuggestion;
use Symfony\Component\Config\Definition\Builder\NodeBuilder;

/**
* Configuration parser handling all basic configuration (aka "common").
*/
class Common extends AbstractParser implements SuggestionCollectorAwareInterface
class Common extends AbstractParser
{
/** @var \Ibexa\Bundle\Core\DependencyInjection\Configuration\Suggestion\Collector\SuggestionCollectorInterface */
private $suggestionCollector;

/**
* Adds semantic configuration definition.
*
Expand All @@ -31,28 +25,6 @@ public function addSemanticConfig(NodeBuilder $nodeBuilder)
{
$nodeBuilder
->scalarNode('repository')->info('The repository to use. Choose among ibexa.repositories.')->end()
// @deprecated
// Use ibexa.repositories / repository settings instead.
->arrayNode('database')
->info('DEPRECATED. Use ibexa.repositories / repository settings instead.')
->children()
->enumNode('type')->values(['mysql', 'pgsql', 'sqlite'])->info('The database driver. Can be mysql, pgsql or sqlite.')->end()
->scalarNode('server')->end()
->scalarNode('port')->end()
->scalarNode('user')->cannotBeEmpty()->end()
->scalarNode('password')->end()
->scalarNode('database_name')->cannotBeEmpty()->end()
->scalarNode('charset')->defaultValue('utf8')->end()
->scalarNode('socket')->end()
->arrayNode('options')
->info('Arbitrary options, supported by your DB driver ("driver-opts" in PDO)')
->example(['foo' => 'bar', 'someOptionName' => ['one', 'two', 'three']])
->useAttributeAsKey('key')
->prototype('variable')->end()
->end()
->scalarNode('dsn')->info('Full database DSN. Will replace settings above.')->example('mysql://root:root@localhost:3306/ezdemo')->end()
->end()
->end()
->scalarNode('cache_service_name')
->example('cache.app')
->info('The cache pool service name to use for a siteaccess / siteaccess-group, *must* be present.')
Expand All @@ -64,13 +36,7 @@ public function addSemanticConfig(NodeBuilder $nodeBuilder)
->end()
->arrayNode('api_keys')
->info('Collection of API keys')
->addDefaultsIfNotSet()
->children()
->scalarNode('google_maps')
->setDeprecated('The child node "%node%" at path "%path%" is no longer used and deprecated.')
->info('Google Maps API Key, required as of Google Maps v3 to make sure maps show up correctly.')
->end()
->end()
->scalarPrototype()->end()
->end()
->scalarNode('storage_dir')
->cannotBeEmpty()
Expand All @@ -80,10 +46,6 @@ public function addSemanticConfig(NodeBuilder $nodeBuilder)
->cannotBeEmpty()
->info('Directory where binary files (from ezbinaryfile field type) are stored. Default value is "original"')
->end()
// @deprecated since 5.3. Will be removed in 6.x.
->scalarNode('session_name')
->info('DEPRECATED. Use session.name instead.')
->end()
->arrayNode('session')
->info('Session options. Will override options defined in Symfony framework.session.*')
->children()
Expand All @@ -98,11 +60,6 @@ public function addSemanticConfig(NodeBuilder $nodeBuilder)
->booleanNode('cookie_httponly')->end()
->end()
->end()
->scalarNode('pagelayout')
->info('The default layout to use')
->example('AppBundle::pagelayout.html.twig')
->setDeprecated('The "pagelayout" option is deprecated. Use "page_layout" instead.')
->end()
->scalarNode('page_layout')
->info('The default layout to use')
->example('AppBundle::page_layout.html.twig')
Expand Down Expand Up @@ -152,9 +109,6 @@ public function preMap(array $config, ContextualizerInterface $contextualizer)

public function mapConfig(array &$scopeSettings, $currentScope, ContextualizerInterface $contextualizer)
{
if (isset($scopeSettings['database'])) {
$this->addDatabaseConfigSuggestion($currentScope, $scopeSettings['database']);
}
if (isset($scopeSettings['repository'])) {
$contextualizer->setContextualParameter('repository', $currentScope, $scopeSettings['repository']);
}
Expand All @@ -176,19 +130,6 @@ public function mapConfig(array &$scopeSettings, $currentScope, ContextualizerIn
$contextualizer->setContextualParameter('api_keys.' . $key, $currentScope, $value);
}

// session_name setting is deprecated in favor of session.name
$container = $contextualizer->getContainer();
$sessionOptions = $container->hasParameter("ibexa.site_access.config.$currentScope.session") ? $container->getParameter("ibexa.site_access.config.$currentScope.session") : [];
if (isset($sessionOptions['name'])) {
$contextualizer->setContextualParameter('session_name', $currentScope, $sessionOptions['name']);
}
// @deprecated session_name is deprecated, but if present, in addition to session.name, consider it instead (BC).
if (isset($scopeSettings['session_name'])) {
$sessionOptions['name'] = $scopeSettings['session_name'];
$contextualizer->setContextualParameter('session_name', $currentScope, $scopeSettings['session_name']);
$contextualizer->setContextualParameter('session', $currentScope, $sessionOptions);
}

if (isset($scopeSettings['http_cache']['purge_servers'])) {
$contextualizer->setContextualParameter('http_cache.purge_servers', $currentScope, $scopeSettings['http_cache']['purge_servers']);
}
Expand All @@ -207,100 +148,8 @@ public function mapConfig(array &$scopeSettings, $currentScope, ContextualizerIn
if (isset($scopeSettings['default_page'])) {
$contextualizer->setContextualParameter('default_page', $currentScope, '/' . ltrim($scopeSettings['default_page'], '/'));
}
if (isset($scopeSettings['pagelayout'])) {
// note: "pagelayout" is deprecated, deprecation message is set via Semantic Config Node Builder
$contextualizer->setContextualParameter('pagelayout', $currentScope, $scopeSettings['pagelayout']);
$contextualizer->setContextualParameter('page_layout', $currentScope, $scopeSettings['pagelayout']);
}
if (isset($scopeSettings['page_layout'])) {
// note: "page_layout" as the new setting always takes precedence
$contextualizer->setContextualParameter('pagelayout', $currentScope, $scopeSettings['page_layout']);
$contextualizer->setContextualParameter('page_layout', $currentScope, $scopeSettings['page_layout']);
}
}

/**
* Injects SuggestionCollector.
*
* @param \Ibexa\Bundle\Core\DependencyInjection\Configuration\Suggestion\Collector\SuggestionCollectorInterface $suggestionCollector
*/
public function setSuggestionCollector(SuggestionCollectorInterface $suggestionCollector)
{
$this->suggestionCollector = $suggestionCollector;
}

private function addDatabaseConfigSuggestion($sa, array $databaseConfig)
{
$suggestion = new ConfigSuggestion(
<<<EOT
Database configuration has changed for Ibexa Content repository.
Please define:
- An entry in ibexa.repositories
- A Doctrine connection (You may check configuration reference for Doctrine "config:dump-reference doctrine" console command.)
- A reference to configured repository in ibexa.system.$sa.repository
EOT
);
$suggestion->setMandatory(true);
$suggestionArray = [
'driver' => 'pdo_mysql',
'host' => 'localhost',
'dbname' => 'my_database',
'user' => 'my_user',
'password' => 'some_password',
'charset' => 'UTF8',
];

if (!empty($databaseConfig)) {
$suggestionArray['dbname'] = $databaseConfig['database_name'];
$suggestionArray['host'] = $databaseConfig['server'];
$driverMap = [
'mysql' => 'pdo_mysql',
'pgsql' => 'pdo_pgsql',
'sqlite' => 'pdo_sqlite',
];
if (isset($driverMap[$databaseConfig['type']])) {
$suggestionArray['driver'] = $driverMap[$databaseConfig['type']];
} else {
$suggestionArray['driver'] = $databaseConfig['type'];
}
if (isset($databaseConfig['socket'])) {
$suggestionArray['unix_socket'] = $databaseConfig['socket'];
}
$suggestionArray['options'] = $databaseConfig['options'];
$suggestionArray['user'] = $databaseConfig['user'];
$suggestionArray['password'] = $databaseConfig['password'];
}
$suggestion->setSuggestion(
[
'doctrine' => [
'dbal' => [
'connections' => [
'default' => $suggestionArray,
],
],
],
'ibexa' => [
'repositories' => [
'my_repository' => [
'storage' => [
'engine' => 'legacy',
'connection' => 'default',
],
'search' => [
'engine' => 'legacy',
'connection' => 'default',
],
],
],
'system' => [
$sa => [
'repository' => 'my_repository',
],
],
],
]
);

$this->suggestionCollector->addSuggestion($suggestion);
}
}
28 changes: 2 additions & 26 deletions src/bundle/Core/DependencyInjection/Configuration/Parser/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,13 @@

use Ibexa\Bundle\Core\DependencyInjection\Configuration\AbstractParser;
use Ibexa\Bundle\Core\DependencyInjection\Configuration\SiteAccessAware\ContextualizerInterface;
use Ibexa\Bundle\Core\DependencyInjection\Configuration\Suggestion\Collector\SuggestionCollectorAwareInterface;
use Ibexa\Bundle\Core\DependencyInjection\Configuration\Suggestion\Collector\SuggestionCollectorInterface;
use Ibexa\Bundle\Core\DependencyInjection\Configuration\Suggestion\ConfigSuggestion;
use Symfony\Component\Config\Definition\Builder\NodeBuilder;

/**
* Configuration parser handling all basic configuration (aka "Image").
*/
class Image extends AbstractParser implements SuggestionCollectorAwareInterface
class Image extends AbstractParser
{
/** @var \Ibexa\Bundle\Core\DependencyInjection\Configuration\Suggestion\Collector\SuggestionCollectorInterface */
private $suggestionCollector;

public function setSuggestionCollector(SuggestionCollectorInterface $suggestionCollector)
{
$this->suggestionCollector = $suggestionCollector;
}

/**
* Adds semantic configuration definition.
*
Expand All @@ -35,13 +24,6 @@ public function setSuggestionCollector(SuggestionCollectorInterface $suggestionC
public function addSemanticConfig(NodeBuilder $nodeBuilder)
{
$nodeBuilder
->arrayNode('imagemagick')
->info('DEPRECATED.')
->children()
->scalarNode('pre_parameters')->info('Parameters that must be run BEFORE the filenames and filters')->end()
->scalarNode('post_parameters')->info('Parameters that must be run AFTER the filenames and filters')->end()
->end()
->end()
->arrayNode('image_variations')
->info('Configuration for your image variations (aka "image aliases")')
->example(
Expand Down Expand Up @@ -119,7 +101,7 @@ static function ($v) {
->end()
->scalarNode('image_host')
->info('Images host. All system images URLs are prefixed with given host if configured.')
->example('https://ezplatform.com')
->example('https://ibexa.co')
->end();
}

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

public function mapConfig(array &$scopeSettings, $currentScope, ContextualizerInterface $contextualizer)
{
if (isset($scopeSettings['imagemagick'])) {
$suggestion = new ConfigSuggestion(
'"imagemagick" settings are deprecated. Just remove them from your configuration file.'
);
$this->suggestionCollector->addSuggestion($suggestion);
}
}
}
16 changes: 0 additions & 16 deletions src/bundle/Core/DependencyInjection/IbexaCoreExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ public function load(array $configs, ContainerBuilder $container)

$this->registerRepositoriesConfiguration($config, $container);
$this->registerSiteAccessConfiguration($config, $container);
$this->registerImageMagickConfiguration($config, $container);
$this->registerUrlAliasConfiguration($config, $container);
$this->registerUrlWildcardsConfiguration($config, $container);
$this->registerOrmConfiguration($config, $container);
Expand Down Expand Up @@ -299,21 +298,6 @@ private function registerSiteAccessConfiguration(array $config, ContainerBuilder
ConfigurationProcessor::setGroupsBySiteAccess($groupsBySiteaccess);
}

private function registerImageMagickConfiguration(array $config, ContainerBuilder $container)
{
if (isset($config['imagemagick'])) {
$container->setParameter('ibexa.image.imagemagick.enabled', $config['imagemagick']['enabled']);
if ($config['imagemagick']['enabled']) {
$container->setParameter('ibexa.image.imagemagick.executable_path', dirname($config['imagemagick']['path']));
$container->setParameter('ibexa.image.imagemagick.executable', basename($config['imagemagick']['path']));
}
}

$filters = isset($config['imagemagick']['filters']) ? $config['imagemagick']['filters'] : [];
$filters = $filters + $container->getParameter('ibexa.image.imagemagick.filters');
$container->setParameter('ibexa.image.imagemagick.filters', $filters);
}

private function registerOrmConfiguration(array $config, ContainerBuilder $container): void
{
if (!isset($config['orm']['entity_mappings'])) {
Expand Down

This file was deleted.

17 changes: 0 additions & 17 deletions src/bundle/Core/Imagine/VariationPathGenerator.php

This file was deleted.

Loading
Loading