From f9921bf9024d900658588be79211a14ae38a670f Mon Sep 17 00:00:00 2001 From: Markus Blaschke Date: Mon, 26 Jun 2017 18:17:59 +0200 Subject: [PATCH 1/4] Fix duplicate pipes in docker exec commands Fixes #114 --- .../CliTools/Shell/CommandBuilder/DockerExecCommandBuilder.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/CliTools/Shell/CommandBuilder/DockerExecCommandBuilder.php b/src/app/CliTools/Shell/CommandBuilder/DockerExecCommandBuilder.php index 1e10c0a..a2a6d6e 100644 --- a/src/app/CliTools/Shell/CommandBuilder/DockerExecCommandBuilder.php +++ b/src/app/CliTools/Shell/CommandBuilder/DockerExecCommandBuilder.php @@ -82,6 +82,7 @@ public function build() } $subCommand = clone $this; + $subCommand->clearPipes(); $subCommand->clearOutputRedirect(); $subCommand->dockerInternalCommand = true; From 88a6bb3377ea571ac2ebdfcca24f8afcf87067b4 Mon Sep 17 00:00:00 2001 From: Philipp Kitzberger Date: Tue, 18 Jul 2017 22:07:54 +0200 Subject: [PATCH 2/4] Ignore DB table sys_registry on DB sync (#115) * Ignore DB table sys_registry on DB sync To prevent errors like this: ===> Restoring dump "/tmp/.clisync-9705/typo3.sql.dump" into database "typo3" - Creating database - Using GZIP decompression - Reading dump ERROR 1062 (23000) at line 5271: Duplicate entry 'tx_scheduler-lastRun' for key 'entry_identifier' * Ignore sys_registry on DB sync --- src/conf/clisync.yml | 1 + src/config.ini | 1 + 2 files changed, 2 insertions(+) diff --git a/src/conf/clisync.yml b/src/conf/clisync.yml index 59829ac..20faf0f 100644 --- a/src/conf/clisync.yml +++ b/src/conf/clisync.yml @@ -48,6 +48,7 @@ GLOBAL: # - "/^index_.*/i" # - "/^sys_log$/i" # - "/^sys_history$/i" + # - "/^sys_registry$/i" # - "/^tx_extbase_cache.*/i" # Transfer compression (none if empty, bzip2 or gzip) diff --git a/src/config.ini b/src/config.ini index 852394b..bad06dd 100644 --- a/src/config.ini +++ b/src/config.ini @@ -48,6 +48,7 @@ typo3[] = "/^cache_.*/i" typo3[] = "/^index_.*/i" typo3[] = "/^sys_log$/i" typo3[] = "/^sys_history$/i" +typo3[] = "/^sys_registry$/i" typo3[] = "/^tx_extbase_cache.*/i" typo3[] = "/^tx_extensionmanager_domain_model_extension.*/i" typo3[] = "/^zzz_deleted_.*/i" From d4d72df165bea193e841d53a648cbbc9ba2fee2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georg=20Gro=C3=9Fberger?= Date: Tue, 17 Sep 2019 11:43:47 +0200 Subject: [PATCH 3/4] [TASK] No gz compression of phar file --- box.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/box.json b/box.json index 5a9a2d0..9cdc14b 100644 --- a/box.json +++ b/box.json @@ -15,6 +15,5 @@ ], "main": "src/command.php", "output": "clitools.phar", - "stub": true, - "compression": "GZ" + "stub": true } From 98fa78b891ae5b23a17e30ebd4769416a9edd772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georg=20Gro=C3=9Fberger?= Date: Tue, 17 Sep 2019 11:44:14 +0200 Subject: [PATCH 4/4] [BUGFIX] Use configured DB connection in mysql:restore command --- src/app/CliTools/Console/Command/AbstractCommand.php | 12 ++++++++---- .../Console/Command/Mysql/RestoreCommand.php | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/app/CliTools/Console/Command/AbstractCommand.php b/src/app/CliTools/Console/Command/AbstractCommand.php index 89c34e7..2c91425 100644 --- a/src/app/CliTools/Console/Command/AbstractCommand.php +++ b/src/app/CliTools/Console/Command/AbstractCommand.php @@ -472,15 +472,19 @@ protected function getDockerMysqlRootPassword($container) * Create mysql CommandBuilder (local or docker) * * - * @param $args... + * @param string $arg * @return CommandBuilder|DockerExecCommandBuilder */ - protected function createMysqlCommand($args) + protected function createMysqlCommand($arg) { + $args = func_get_args(); + $args[] = '-u' . DatabaseConnection::getDbUsername(); + $args[] = '-p' . DatabaseConnection::getDbPassword(); + if ($this->getLocalDockerContainer(\CliTools\Console\Command\AbstractDockerCommand::DOCKER_ALIAS_MYSQL )) { - $command = $this->createDockerMysqlCommand($this->getLocalDockerContainer(\CliTools\Console\Command\AbstractDockerCommand::DOCKER_ALIAS_MYSQL ), func_get_args()); + $command = $this->createDockerMysqlCommand($this->getLocalDockerContainer(\CliTools\Console\Command\AbstractDockerCommand::DOCKER_ALIAS_MYSQL ), $args); } else { - $command = $this->createLocalMysqlCommand(func_get_args()); + $command = $this->createLocalMysqlCommand($args); } return $command; diff --git a/src/app/CliTools/Console/Command/Mysql/RestoreCommand.php b/src/app/CliTools/Console/Command/Mysql/RestoreCommand.php index 382077b..680ca10 100644 --- a/src/app/CliTools/Console/Command/Mysql/RestoreCommand.php +++ b/src/app/CliTools/Console/Command/Mysql/RestoreCommand.php @@ -75,8 +75,8 @@ public function execute(InputInterface $input, OutputInterface $output) $output->writeln('

Restoring dump "' . $dumpFile . '" into database "' . $database . '"

'); $output->writeln('

Creating database

'); - $this->execSqlCommand('DROP DATABASE IF EXISTS ' . addslashes($database), 'mysql'); - $this->execSqlCommand('CREATE DATABASE ' . addslashes($database),'mysql'); + $this->execSqlCommand('DROP DATABASE IF EXISTS ' . addslashes($database)); + $this->execSqlCommand('CREATE DATABASE ' . addslashes($database)); $commandMysql = $this->createMysqlCommand($database, '--one-database');