Code Duplication    Length = 19-21 lines in 2 locations

phpgwapi/inc/adodb/drivers/adodb-oci8.inc.php 1 location

@@ 190-208 (lines=19) @@
187
        $this->_errorMsg = false;
188
		$this->_errorCode = false;
189
		
190
		if($argHostname) { // added by Jorma Tuomainen <[email protected]>
191
			if (empty($argDatabasename)) $argDatabasename = $argHostname;
192
			else {
193
				if(strpos($argHostname,":")) {
194
					$argHostinfo=explode(":",$argHostname);
195
				   	$argHostname=$argHostinfo[0];
196
					$argHostport=$argHostinfo[1];
197
			 	} else {
198
					$argHostport="1521";
199
	   			}
200
				
201
				if ($this->connectSID) {
202
					$argDatabasename="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=".$argHostname
203
					.")(PORT=$argHostport))(CONNECT_DATA=(SID=$argDatabasename)))";
204
				} else
205
					$argDatabasename="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=".$argHostname
206
					.")(PORT=$argHostport))(CONNECT_DATA=(SERVICE_NAME=$argDatabasename)))";
207
			}
208
		}
209
				
210
 		//if ($argHostname) print "<p>Connect: 1st argument should be left blank for $this->databaseType</p>";
211
		if ($mode==1) {

phpgwapi/inc/adodb/drivers/adodb-oracle.inc.php 1 location

@@ 130-150 (lines=21) @@
127
            // the oracle home to the host name of remote DB?
128
//			if ($argHostname) putenv("ORACLE_HOME=$argHostname");
129
130
			if($argHostname) { // code copied from version submitted for oci8 by Jorma Tuomainen <[email protected]>
131
				if (empty($argDatabasename)) $argDatabasename = $argHostname;
132
				else {
133
					if(strpos($argHostname,":")) {
134
						$argHostinfo=explode(":",$argHostname);
135
						$argHostname=$argHostinfo[0];
136
						$argHostport=$argHostinfo[1];
137
					} else {
138
						$argHostport="1521";
139
					}
140
141
142
					if ($this->connectSID) {
143
						$argDatabasename="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=".$argHostname
144
						.")(PORT=$argHostport))(CONNECT_DATA=(SID=$argDatabasename)))";
145
					} else
146
						$argDatabasename="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=".$argHostname
147
						.")(PORT=$argHostport))(CONNECT_DATA=(SERVICE_NAME=$argDatabasename)))";
148
				}
149
150
			}
151
152
			if ($argDatabasename) $argUsername .= "@$argDatabasename";
153