Skip to content

Commit

Permalink
Merge branch '4.6'
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
  • Loading branch information
leofeyer committed Sep 11, 2018
2 parents ff0eeb4 + 9c03f2e commit a7c95b5
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 416 deletions.
1 change: 0 additions & 1 deletion composer.json
Expand Up @@ -15,7 +15,6 @@
"doctrine/dbal": "^2.5",
"patchwork/utf8": "^1.2",
"psr/log": "^1.0",
"sensio/framework-extra-bundle": "^5.0",
"sensiolabs/ansi-to-html": "^1.1",
"symfony/config": "3.4.* || 4.1.*",
"symfony/console": "3.4.* || 4.1.*",
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/InstallationController.php
Expand Up @@ -20,14 +20,14 @@
use Contao\InstallationBundle\Event\InitializeApplicationEvent;
use Doctrine\DBAL\DBALException;
use Patchwork\Utf8;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Finder\SplFileInfo;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

/**
* @Route("/contao", defaults={"_scope" = "backend", "_token_check" = true})
Expand Down
13 changes: 11 additions & 2 deletions src/Database/Installer.php
Expand Up @@ -197,15 +197,24 @@ private function checkEngineAndCollation(array &$sql, Schema $toSchema): void
}

$engine = $table->getOption('engine');
$innodb = 'innodb' === strtolower($engine);

if ($tableOptions->Engine !== $engine) {
if ('InnoDB' === $engine) {
if (strtolower($tableOptions->Engine) !== strtolower($engine)) {
if ($innodb) {
$command = 'ALTER TABLE '.$tableName.' ENGINE = '.$engine.' ROW_FORMAT = DYNAMIC';
} else {
$command = 'ALTER TABLE '.$tableName.' ENGINE = '.$engine;
}

$sql['ALTER_TABLE'][md5($command)] = $command;
} elseif ($innodb) {
$rowFormat = $table->getOption('row_format');

if ($rowFormat && strtolower($tableOptions->Row_format) !== strtolower($rowFormat)) {
$command = 'ALTER TABLE '.$tableName.' ENGINE = '.$engine.' ROW_FORMAT = DYNAMIC';

$sql['ALTER_TABLE'][md5($command)] = $command;
}
}

$collate = $table->getOption('collate');
Expand Down
9 changes: 7 additions & 2 deletions src/Database/Version447Update.php
Expand Up @@ -108,8 +108,13 @@ public function run(): void
if ($this->hasMessage()) {
$translator = $this->container->get('translator');

$this->prependMessage(sprintf('<p>%s</p><ul>', $translator->trans('duplicate_subscriptions')));
$this->addMessage(sprintf('</ul><p>%s</p>', $translator->trans('duplicates_purged')));
$this->prependMessage(sprintf(
'<h3>%s</h3><p>%s</p><ul>',
$translator->trans('duplicate_subscriptions'),
$translator->trans('duplicate_subscriptions_begin')
));

$this->addMessage(sprintf('</ul><p>%s</p>', $translator->trans('duplicate_subscriptions_end')));
}
}
}
14 changes: 14 additions & 0 deletions src/Database/Version450Update.php
Expand Up @@ -42,6 +42,20 @@ public function run(): void
youtubeOptions text NULL
');

$this->connection->query("
ALTER TABLE
tl_content
ADD
youtubeStart int(10) unsigned NOT NULL default '0'
");

$this->connection->query("
ALTER TABLE
tl_content
ADD
youtubeStop int(10) unsigned NOT NULL default '0'
");

$this->connection->query("
UPDATE
tl_form_field
Expand Down
11 changes: 9 additions & 2 deletions src/DependencyInjection/ContaoInstallationExtension.php
Expand Up @@ -30,8 +30,15 @@ public function load(array $configs, ContainerBuilder $container): void
new FileLocator(__DIR__.'/../Resources/config')
);

$loader->load('listener.yml');
$loader->load('services.yml');
static $files = [
'commands.yml',
'listener.yml',
'services.yml',
];

foreach ($files as $file) {
$loader->load($file);
}
}

/**
Expand Down
9 changes: 9 additions & 0 deletions src/Resources/config/commands.yml
@@ -0,0 +1,9 @@
services:
_defaults:
autoconfigure: true

contao.command.lock:
class: Contao\InstallationBundle\Command\LockCommand

contao.command.unlock:
class: Contao\InstallationBundle\Command\UnlockCommand

0 comments on commit a7c95b5

Please sign in to comment.