Code Duplication    Length = 10-10 lines in 2 locations

src/Webroot.php 1 location

@@ 97-106 (lines=10) @@
94
95
		$hostArg = '';
96
		$portArg = '';
97
		if (!empty($conf['db_server']) && $conf['db_server'] != 'localhost') {
98
			if (strpos($conf['db_server'], ':')!==false) {
99
				// Handle "server:port" format.
100
				$server = explode(':', $conf['db_server'], 2);
101
				$hostArg = escapeshellarg("--host=".$server[0]);
102
				$portArg = escapeshellarg("--port=".$server[1]);
103
			} else {
104
				$hostArg = escapeshellarg("--host=".$conf['db_server']);
105
			}
106
		}
107
		$dbCommand = "create database if not exists `" . addslashes($conf['db_database']) . "`";
108
		if($dropdb) {
109
			$dbCommand = "drop database if exists `" . addslashes($conf['db_database']) . "`; " . $dbCommand;

src/SSPak.php 1 location

@@ 213-222 (lines=10) @@
210
211
		$hostArg = '';
212
		$portArg = '';
213
		if (!empty($conf['db_server']) && $conf['db_server'] != 'localhost') {
214
			if (strpos($conf['db_server'], ':')!==false) {
215
				// Handle "server:port" format.
216
				$server = explode(':', $conf['db_server'], 2);
217
				$hostArg = escapeshellarg("--host=".$server[0]);
218
				$portArg = escapeshellarg("--port=".$server[1]);
219
			} else {
220
				$hostArg = escapeshellarg("--host=".$conf['db_server']);
221
			}
222
		}
223
224
		$filenameArg = escapeshellarg($filename);
225