@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | $userToDropSpecs = []; |
| 53 | - foreach($instanceList as $instanceName => $instanceSpecs) { |
|
| 53 | + foreach ($instanceList as $instanceName => $instanceSpecs) { |
|
| 54 | 54 | $userToDropSpecs[$instanceName] = [ |
| 55 | 55 | 'user' => $userName |
| 56 | 56 | ]; |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | $this->writeResults($results, $time); |
| 66 | 66 | |
| 67 | - return (int)$results['failed']; |
|
| 67 | + return (int) $results['failed']; |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | return $this->executeSqlAction( |
| 80 | 80 | $instanceList, |
| 81 | 81 | 'Dropping of user', |
| 82 | - function ($schemaManager, $instanceName) use ($userToDropSpecs, $ifExists) { |
|
| 82 | + function($schemaManager, $instanceName) use ($userToDropSpecs, $ifExists) { |
|
| 83 | 83 | $dbConnectionSpec = $userToDropSpecs[$instanceName]; |
| 84 | 84 | /** @var DatabaseSchemaManager $schemaManager */ |
| 85 | 85 | return $schemaManager->getDropUserSqlAction( |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $result = $this->listInstances($instanceList); |
| 38 | 38 | |
| 39 | 39 | $extraResults = $this->listDatabasesVersion($instanceList)['data']; |
| 40 | - foreach($result as $instanceName => $instanceDesc) { |
|
| 40 | + foreach ($result as $instanceName => $instanceDesc) { |
|
| 41 | 41 | if (isset($extraResults[$instanceName])) { |
| 42 | 42 | $result[$instanceName]['version'] = $extraResults[$instanceName]; |
| 43 | 43 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | protected function listInstances($instanceList) |
| 57 | 57 | { |
| 58 | 58 | $out = []; |
| 59 | - foreach($instanceList as $instanceName => $connectionSpec) { |
|
| 59 | + foreach ($instanceList as $instanceName => $connectionSpec) { |
|
| 60 | 60 | //$connectionSpec = $this->dbConfigurationManager->getInstanceConfiguration($instanceName); |
| 61 | 61 | $out[$instanceName] = [ |
| 62 | 62 | 'vendor' => $connectionSpec['vendor'], |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | return $this->executeSqlAction( |
| 72 | 72 | $instanceList, |
| 73 | 73 | 'Getting database version information', |
| 74 | - function ($schemaManager, $instanceName) { |
|
| 74 | + function($schemaManager, $instanceName) { |
|
| 75 | 75 | /** @var DatabaseSchemaManager $schemaManager */ |
| 76 | 76 | return $schemaManager->getRetrieveVersionInfoSqlAction(); |
| 77 | 77 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | file_put_contents($this->outputFile, $data); |
| 102 | 102 | $this->writeln("Results saved to file {$this->outputFile}"); |
| 103 | 103 | } else { |
| 104 | - $this->writeln($data, OutputInterface::VERBOSITY_QUIET, OutputInterface::OUTPUT_RAW); |
|
| 104 | + $this->writeln($data, OutputInterface::VERBOSITY_QUIET, OutputInterface::OUTPUT_RAW); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | } |
@@ -29,13 +29,13 @@ discard block |
||
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | $names = []; |
| 32 | - foreach(array_keys($this->instanceList) as $name) { |
|
| 32 | + foreach (array_keys($this->instanceList) as $name) { |
|
| 33 | 33 | |
| 34 | 34 | if (empty($includeFilter)) { |
| 35 | 35 | $include = true; |
| 36 | 36 | } else { |
| 37 | 37 | $include = false; |
| 38 | - foreach($includeFilter as $filter) { |
|
| 38 | + foreach ($includeFilter as $filter) { |
|
| 39 | 39 | if (fnmatch($filter, $name)) { |
| 40 | 40 | $include = true; |
| 41 | 41 | break; |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | if ($include && !empty($excludeFilter)) { |
| 47 | - foreach($excludeFilter as $filter) { |
|
| 47 | + foreach ($excludeFilter as $filter) { |
|
| 48 | 48 | if (fnmatch($filter, $name)) { |
| 49 | 49 | $include = false; |
| 50 | 50 | break; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | public function getInstancesConfiguration(array $instanceNames) |
| 82 | 82 | { |
| 83 | 83 | $instancesDefinitions = []; |
| 84 | - foreach($instanceNames as $instanceName) |
|
| 84 | + foreach ($instanceNames as $instanceName) |
|
| 85 | 85 | { |
| 86 | 86 | $instancesDefinitions[$instanceName] = $this->getInstanceConfiguration($instanceName); |
| 87 | 87 | } |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | } |
| 54 | 54 | $executor = $this->executorFactory->createForkedExecutor($instanceName, $dbConnectionSpec, NativeClient::EXECUTION_STRATEGY, false); |
| 55 | 55 | |
| 56 | - if (! $executor instanceof ShellExecutor) { |
|
| 56 | + if (!$executor instanceof ShellExecutor) { |
|
| 57 | 57 | throw new \Exception("Can not start an interactive shell for databases of type '{$dbConnectionSpec['vendor']}'"); |
| 58 | 58 | } |
| 59 | 59 | |
@@ -51,18 +51,18 @@ discard block |
||
| 51 | 51 | $options = [ |
| 52 | 52 | 'bin/dbconsole', |
| 53 | 53 | 'sql:execute', |
| 54 | - '--only-instances=' . $this->instanceName, |
|
| 54 | + '--only-instances='.$this->instanceName, |
|
| 55 | 55 | '--execute-in-process', |
| 56 | - '--execution-strategy=' . static::EXECUTION_STRATEGY, |
|
| 56 | + '--execution-strategy='.static::EXECUTION_STRATEGY, |
|
| 57 | 57 | '--output-type=json', |
| 58 | 58 | ]; |
| 59 | 59 | |
| 60 | 60 | switch ($action) { |
| 61 | 61 | case self::EXECUTE_COMMAND: |
| 62 | - $options[] = '--sql=' . $sqlOrFilename; |
|
| 62 | + $options[] = '--sql='.$sqlOrFilename; |
|
| 63 | 63 | break; |
| 64 | 64 | case self::EXECUTE_FILE: |
| 65 | - $options[] = '--file=' . $sqlOrFilename; |
|
| 65 | + $options[] = '--file='.$sqlOrFilename; |
|
| 66 | 66 | break; |
| 67 | 67 | default: |
| 68 | 68 | throw new \OutOfBoundsException('Unsupported action: $action'); |
@@ -72,13 +72,13 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | if ($instanceConfiguration != $this->databaseConfiguration) { |
| 74 | 74 | if (isset($this->databaseConfiguration['dbname'])) { |
| 75 | - $options[] = '--database=' . $this->databaseConfiguration['dbname']; |
|
| 75 | + $options[] = '--database='.$this->databaseConfiguration['dbname']; |
|
| 76 | 76 | } |
| 77 | 77 | if (isset($this->databaseConfiguration['user'])) { |
| 78 | - $options[] = '--user=' . $this->databaseConfiguration['user']; |
|
| 78 | + $options[] = '--user='.$this->databaseConfiguration['user']; |
|
| 79 | 79 | } |
| 80 | 80 | if (isset($this->databaseConfiguration['password'])) { |
| 81 | - $options[] = '--password=' . $this->databaseConfiguration['password']; |
|
| 81 | + $options[] = '--password='.$this->databaseConfiguration['password']; |
|
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | |
@@ -54,10 +54,10 @@ discard block |
||
| 54 | 54 | case 'mysql': |
| 55 | 55 | $command = 'mysql'; |
| 56 | 56 | $options = [ |
| 57 | - '--host=' . $this->databaseConfiguration['host'], |
|
| 58 | - '--port=' . $this->databaseConfiguration['port'] ?? '3306', |
|
| 59 | - '--user=' . $this->databaseConfiguration['user'], |
|
| 60 | - '-p' . $this->databaseConfiguration['password'], |
|
| 57 | + '--host='.$this->databaseConfiguration['host'], |
|
| 58 | + '--port='.$this->databaseConfiguration['port'] ?? '3306', |
|
| 59 | + '--user='.$this->databaseConfiguration['user'], |
|
| 60 | + '-p'.$this->databaseConfiguration['password'], |
|
| 61 | 61 | '--binary-mode', // 'It also disables all mysql commands except charset and delimiter in non-interactive mode (for input piped to mysql or loaded using the source command)' |
| 62 | 62 | '-t', |
| 63 | 63 | ]; |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $options[] = $this->databaseConfiguration['dbname']; |
| 66 | 66 | } |
| 67 | 67 | if ($action == self::EXECUTE_COMMAND) { |
| 68 | - $options[] = '--execute=' . $sqlOrFilename; |
|
| 68 | + $options[] = '--execute='.$sqlOrFilename; |
|
| 69 | 69 | } |
| 70 | 70 | // $env = [ |
| 71 | 71 | // problematic when wrapping the process in a call to `time`... |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | // NB: this triggers a different behaviour that piping multiple commands to stdin, namely |
| 88 | 88 | // it wraps all of the commands in a transaction and allows either sql commands or a single meta-command |
| 89 | 89 | if ($action == self::EXECUTE_COMMAND) { |
| 90 | - $options[] = '--command=' . $sqlOrFilename; |
|
| 90 | + $options[] = '--command='.$sqlOrFilename; |
|
| 91 | 91 | } |
| 92 | 92 | //$env = [ |
| 93 | 93 | // problematic when wrapping the process in a call to `time`... |
@@ -98,19 +98,19 @@ discard block |
||
| 98 | 98 | case 'sqlcmd': |
| 99 | 99 | $command = 'sqlcmd'; |
| 100 | 100 | $options = [ |
| 101 | - '-S' . $this->databaseConfiguration['host'] . ($this->databaseConfiguration['port'] != '' ? ',' . $this->databaseConfiguration['port'] : ''), |
|
| 102 | - '-U' . $this->databaseConfiguration['user'], |
|
| 103 | - '-P' . $this->databaseConfiguration['password'], |
|
| 101 | + '-S'.$this->databaseConfiguration['host'].($this->databaseConfiguration['port'] != '' ? ','.$this->databaseConfiguration['port'] : ''), |
|
| 102 | + '-U'.$this->databaseConfiguration['user'], |
|
| 103 | + '-P'.$this->databaseConfiguration['password'], |
|
| 104 | 104 | '-r1', |
| 105 | 105 | '-b', |
| 106 | 106 | ]; |
| 107 | 107 | if (isset($this->databaseConfiguration['dbname'])) { |
| 108 | - $options[] = '-d' . $this->databaseConfiguration['dbname']; |
|
| 108 | + $options[] = '-d'.$this->databaseConfiguration['dbname']; |
|
| 109 | 109 | } |
| 110 | 110 | if ($action == self::EXECUTE_FILE) { |
| 111 | - $options[] = '-i' . $sqlOrFilename; |
|
| 111 | + $options[] = '-i'.$sqlOrFilename; |
|
| 112 | 112 | } elseif ($action == self::EXECUTE_COMMAND) { |
| 113 | - $options[] = '-Q' . $sqlOrFilename; |
|
| 113 | + $options[] = '-Q'.$sqlOrFilename; |
|
| 114 | 114 | } |
| 115 | 115 | break; |
| 116 | 116 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | // 'path' is the full path to the 'master' db (for Doctrine compatibility). |
| 120 | 120 | // non-master dbs are supposed to reside in the same directory |
| 121 | 121 | if (isset($this->databaseConfiguration['dbname'])) { |
| 122 | - $options[] = dirname($this->databaseConfiguration['path']) . '/' . $this->databaseConfiguration['dbname'] . '.sqlite'; |
|
| 122 | + $options[] = dirname($this->databaseConfiguration['path']).'/'.$this->databaseConfiguration['dbname'].'.sqlite'; |
|
| 123 | 123 | } else { |
| 124 | 124 | $options[] = $this->databaseConfiguration['path']; |
| 125 | 125 | } |
@@ -133,22 +133,22 @@ discard block |
||
| 133 | 133 | /// @todo disable execution of dangerous (or all) SQLPLUS commands. |
| 134 | 134 | /// See the list at https://docs.oracle.com/en/database/oracle/oracle-database/18/sqpug/SQL-Plus-command-reference.html#GUID-177F24B7-D154-4F8B-A05B-7568079800C6 |
| 135 | 135 | $command = 'sqlplus'; |
| 136 | - $connectionIdentifier = '//' . $this->databaseConfiguration['host'] . |
|
| 137 | - ($this->databaseConfiguration['port'] != '' ? ':' . $this->databaseConfiguration['port'] : ''); |
|
| 136 | + $connectionIdentifier = '//'.$this->databaseConfiguration['host']. |
|
| 137 | + ($this->databaseConfiguration['port'] != '' ? ':'.$this->databaseConfiguration['port'] : ''); |
|
| 138 | 138 | // nb: for oracle, if we use pdbs to map 'databases', they get a new service name |
| 139 | 139 | /// @todo allow support for _not_ doing that, and using schemas as 'databases' |
| 140 | 140 | if (isset($this->databaseConfiguration['servicename'])) { |
| 141 | - $connectionIdentifier .= '/' . $this->databaseConfiguration['servicename']; |
|
| 141 | + $connectionIdentifier .= '/'.$this->databaseConfiguration['servicename']; |
|
| 142 | 142 | } else { |
| 143 | 143 | if ($this->databaseConfiguration['dbname'] != '') { |
| 144 | - $connectionIdentifier .= '/' . $this->databaseConfiguration['dbname']; |
|
| 144 | + $connectionIdentifier .= '/'.$this->databaseConfiguration['dbname']; |
|
| 145 | 145 | } |
| 146 | 146 | } |
| 147 | 147 | $options = [ |
| 148 | 148 | '-L', // 'attempts to log in just once, instead of reprompting on error' |
| 149 | 149 | '-NOLOGINTIME', |
| 150 | 150 | '-S', |
| 151 | - $this->databaseConfiguration['user'] . '/' . $this->databaseConfiguration['password'] . '@' . $connectionIdentifier, |
|
| 151 | + $this->databaseConfiguration['user'].'/'.$this->databaseConfiguration['password'].'@'.$connectionIdentifier, |
|
| 152 | 152 | ]; |
| 153 | 153 | /// @todo make this optional somehow / allow SYSOPER as alternative |
| 154 | 154 | if (strtolower($this->databaseConfiguration['user']) === 'sys') { |
@@ -158,10 +158,10 @@ discard block |
||
| 158 | 158 | if ($action == self::EXECUTE_FILE) { |
| 159 | 159 | /// @todo wouldn't it be better to create another temp file with prefixed the sqlplus commands? |
| 160 | 160 | //$options[] = '@' . $sqlOrFilename; |
| 161 | - $sqlOrFilename = "WHENEVER OSERROR EXIT FAILURE;\nWHENEVER SQLERROR EXIT SQL.SQLCODE;\nSET PAGESIZE 50000;\nSET FEEDBACK OFF;\n" . file_get_contents($sqlOrFilename); |
|
| 161 | + $sqlOrFilename = "WHENEVER OSERROR EXIT FAILURE;\nWHENEVER SQLERROR EXIT SQL.SQLCODE;\nSET PAGESIZE 50000;\nSET FEEDBACK OFF;\n".file_get_contents($sqlOrFilename); |
|
| 162 | 162 | $action = self::EXECUTE_COMMAND; |
| 163 | 163 | } else { |
| 164 | - $sqlOrFilename = "WHENEVER OSERROR EXIT FAILURE;\nWHENEVER SQLERROR EXIT SQL.SQLCODE;\nSET PAGESIZE 50000;\nSET FEEDBACK OFF;\n" . $sqlOrFilename; |
|
| 164 | + $sqlOrFilename = "WHENEVER OSERROR EXIT FAILURE;\nWHENEVER SQLERROR EXIT SQL.SQLCODE;\nSET PAGESIZE 50000;\nSET FEEDBACK OFF;\n".$sqlOrFilename; |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | break; |
@@ -174,11 +174,11 @@ discard block |
||
| 174 | 174 | |
| 175 | 175 | /// @todo investigate: for psql is this better done via --file ? |
| 176 | 176 | if ($action == self::EXECUTE_FILE && $clientType != 'sqlsrv' && $clientType != 'sqlplus') { |
| 177 | - $commandLine .= ' < ' . escapeshellarg($sqlOrFilename); |
|
| 177 | + $commandLine .= ' < '.escapeshellarg($sqlOrFilename); |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | if ($action == self::EXECUTE_COMMAND && $clientType == 'sqlplus') { |
| 181 | - $commandLine .= " << 'SQLEOF'\n" . $sqlOrFilename . "\nSQLEOF"; |
|
| 181 | + $commandLine .= " << 'SQLEOF'\n".$sqlOrFilename."\nSQLEOF"; |
|
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | $process = Process::fromShellCommandline($commandLine, null, $env); |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | array_shift($output); // headers |
| 226 | 226 | array_shift($output); // '+--+' |
| 227 | 227 | array_pop($output); // '+--+' |
| 228 | - foreach($output as &$line) { |
|
| 228 | + foreach ($output as &$line) { |
|
| 229 | 229 | $line = trim($line, '|'); |
| 230 | 230 | $line = trim($line); |
| 231 | 231 | } |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | array_shift($output); // empty line |
| 236 | 236 | array_shift($output); // headers |
| 237 | 237 | array_shift($output); // '---' |
| 238 | - foreach($output as &$line) { |
|
| 238 | + foreach ($output as &$line) { |
|
| 239 | 239 | $line = trim($line); |
| 240 | 240 | } |
| 241 | 241 | return $output; |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | array_shift($output); // headers |
| 245 | 245 | array_shift($output); // '---' |
| 246 | 246 | //array_pop($output); // '(N rows)' |
| 247 | - foreach($output as &$line) { |
|
| 247 | + foreach ($output as &$line) { |
|
| 248 | 248 | $line = trim($line); |
| 249 | 249 | } |
| 250 | 250 | return $output; |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | array_shift($output); // '---' |
| 258 | 258 | array_pop($output); // blank line |
| 259 | 259 | array_pop($output); // '(N rows affected)' |
| 260 | - foreach($output as &$line) { |
|
| 260 | + foreach ($output as &$line) { |
|
| 261 | 261 | $line = trim($line); |
| 262 | 262 | } |
| 263 | 263 | return $output; |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | { |
| 18 | 18 | return new Command( |
| 19 | 19 | 'SELECT datname AS "Database" FROM pg_database ORDER BY datname;', |
| 20 | - function ($output, $executor) { |
|
| 20 | + function($output, $executor) { |
|
| 21 | 21 | /** @var Executor $executor */ |
| 22 | 22 | return $executor->resultSetToArray($output); |
| 23 | 23 | } |
@@ -40,11 +40,11 @@ discard block |
||
| 40 | 40 | $statements = [ |
| 41 | 41 | // q: do we need to add 'TEMPLATE template0' ? |
| 42 | 42 | // see f.e. https://www.vertabelo.com/blog/collations-in-postgresql/ |
| 43 | - "CREATE DATABASE \"$dbName\"" . ($collation !== null ? " ENCODING $collation" : '') . ';', |
|
| 43 | + "CREATE DATABASE \"$dbName\"".($collation !== null ? " ENCODING $collation" : '').';', |
|
| 44 | 44 | ]; |
| 45 | 45 | if ($userName != '') { |
| 46 | 46 | $statements[] = "COMMIT;"; |
| 47 | - $statements[] = "CREATE USER \"$userName\" WITH PASSWORD '$password'" . ';'; |
|
| 47 | + $statements[] = "CREATE USER \"$userName\" WITH PASSWORD '$password'".';'; |
|
| 48 | 48 | $statements[] = "GRANT ALL ON DATABASE \"$dbName\" TO \"$userName\""; // q: should we avoid granting CREATE? |
| 49 | 49 | } |
| 50 | 50 | return new Command($statements); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | { |
| 83 | 83 | return new Command( |
| 84 | 84 | 'SELECT usename AS "User" FROM pg_catalog.pg_user ORDER BY usename;', |
| 85 | - function ($output, $executor) { |
|
| 85 | + function($output, $executor) { |
|
| 86 | 86 | /** @var Executor $executor */ |
| 87 | 87 | return $executor->resultSetToArray($output); |
| 88 | 88 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | { |
| 116 | 116 | return new Command( |
| 117 | 117 | 'SELECT collname AS Collation FROM pg_collation ORDER BY collname', |
| 118 | - function ($output, $executor) { |
|
| 118 | + function($output, $executor) { |
|
| 119 | 119 | /** @var Executor $executor */ |
| 120 | 120 | return $executor->resultSetToArray($output); |
| 121 | 121 | } |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | { |
| 131 | 131 | return new Command( |
| 132 | 132 | 'SHOW server_version;', |
| 133 | - function ($output, $executor) { |
|
| 133 | + function($output, $executor) { |
|
| 134 | 134 | /** @var Executor $executor */ |
| 135 | 135 | return $executor->resultSetToArray($output)[0]; |
| 136 | 136 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | // the way we create it, the user account is contained in the db |
| 20 | 20 | // @todo add "WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb')" ? |
| 21 | 21 | "SELECT name AS 'Database' FROM sys.databases ORDER BY name;", |
| 22 | - function ($output, $executor) { |
|
| 22 | + function($output, $executor) { |
|
| 23 | 23 | /** @var Executor $executor */ |
| 24 | 24 | return $executor->resultSetToArray($output); |
| 25 | 25 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | // Also, by default connections are in autocommit mode... |
| 46 | 46 | // And yet, we need a GO to commit the db creation... |
| 47 | 47 | "SET QUOTED_IDENTIFIER ON;", |
| 48 | - "CREATE DATABASE \"$dbName\"" . ($collation !== null ? " COLLATE $collation" : '') . ';' |
|
| 48 | + "CREATE DATABASE \"$dbName\"".($collation !== null ? " COLLATE $collation" : '').';' |
|
| 49 | 49 | ]; |
| 50 | 50 | if ($userName != '') { |
| 51 | 51 | $statements[] = "CREATE LOGIN \"$userName\" WITH PASSWORD = '$password', DEFAULT_DATABASE = \"$dbName\", CHECK_POLICY = OFF, CHECK_EXPIRATION = OFF;"; |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | { |
| 96 | 96 | return new Command( |
| 97 | 97 | "SELECT name AS 'User' FROM sys.sql_logins ORDER BY name", |
| 98 | - function ($output, $executor) { |
|
| 98 | + function($output, $executor) { |
|
| 99 | 99 | /** @var Executor $executor */ |
| 100 | 100 | return $executor->resultSetToArray($output); |
| 101 | 101 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | { |
| 133 | 133 | return new Command( |
| 134 | 134 | 'SELECT name AS Collation FROM fn_helpcollations();', |
| 135 | - function ($output, $executor) { |
|
| 135 | + function($output, $executor) { |
|
| 136 | 136 | /** @var Executor $executor */ |
| 137 | 137 | return $executor->resultSetToArray($output); |
| 138 | 138 | } |
@@ -147,12 +147,12 @@ discard block |
||
| 147 | 147 | { |
| 148 | 148 | return new Command( |
| 149 | 149 | "SELECT @@version", |
| 150 | - function ($output, $executor) { |
|
| 150 | + function($output, $executor) { |
|
| 151 | 151 | /** @var Executor $executor */ |
| 152 | 152 | $output = $executor->resultSetToArray($output); |
| 153 | 153 | $line = $output[0]; |
| 154 | 154 | preg_match('/Microsoft SQL Server +([^ ]+) +([^ ]+) +/', $line, $matches); |
| 155 | - return $matches[1] . ' ' . $matches[2]; |
|
| 155 | + return $matches[1].' '.$matches[2]; |
|
| 156 | 156 | } |
| 157 | 157 | ); |
| 158 | 158 | } |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | return new Command( |
| 19 | 19 | /// @todo use 'SHOW DATABASES' for versions < 5 |
| 20 | 20 | "SELECT SCHEMA_NAME AS 'Database' FROM information_schema.SCHEMATA ORDER BY SCHEMA_NAME;", |
| 21 | - function ($output, $executor) { |
|
| 21 | + function($output, $executor) { |
|
| 22 | 22 | /** @var Executor $executor */ |
| 23 | 23 | return $executor->resultSetToArray($output); |
| 24 | 24 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | /// @todo if mysql version is bigger than 8.0, add `WITH mysql_native_password` |
| 42 | 42 | $statements = [ |
| 43 | - "CREATE DATABASE `$dbName`" . ($collation !== null ? " CHARACTER SET $collation" : '') . ';' |
|
| 43 | + "CREATE DATABASE `$dbName`".($collation !== null ? " CHARACTER SET $collation" : '').';' |
|
| 44 | 44 | ]; |
| 45 | 45 | if ($userName != '') { |
| 46 | 46 | $statements[] = "CREATE USER '$userName'@'%' IDENTIFIED BY '$password';"; |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | { |
| 84 | 84 | return new Command( |
| 85 | 85 | 'SELECT DISTINCT User FROM mysql.user ORDER BY User;', |
| 86 | - function ($output, $executor) { |
|
| 86 | + function($output, $executor) { |
|
| 87 | 87 | /** @var Executor $executor */ |
| 88 | 88 | return $executor->resultSetToArray($output); |
| 89 | 89 | } |
@@ -118,13 +118,13 @@ discard block |
||
| 118 | 118 | { |
| 119 | 119 | return new Command( |
| 120 | 120 | 'SHOW COLLATION;', |
| 121 | - function ($output, $executor) { |
|
| 121 | + function($output, $executor) { |
|
| 122 | 122 | /** @var Executor $executor */ |
| 123 | 123 | $lines = $executor->resultSetToArray($output); |
| 124 | 124 | $out = []; |
| 125 | - foreach($lines as $line) { |
|
| 125 | + foreach ($lines as $line) { |
|
| 126 | 126 | $parts = explode("|", $line, 3); |
| 127 | - $out[] = trim($parts[0]) . ' (' . trim($parts[1]) .')'; |
|
| 127 | + $out[] = trim($parts[0]).' ('.trim($parts[1]).')'; |
|
| 128 | 128 | } |
| 129 | 129 | return $out; |
| 130 | 130 | } |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | { |
| 140 | 140 | return new Command( |
| 141 | 141 | 'SHOW VARIABLES LIKE "version";', |
| 142 | - function ($output, $executor) { |
|
| 142 | + function($output, $executor) { |
|
| 143 | 143 | /** @var Executor $executor */ |
| 144 | 144 | $line = $executor->resultSetToArray($output)[0]; |
| 145 | 145 | $parts = explode('|', $line); |