Merge branch 'master' of bitbucket.org:colosa/processmaker into PM-2835
This commit is contained in:
@@ -154,7 +154,7 @@ class dbConnections
|
||||
$result = DbSourcePeer::doSelectRS( $c );
|
||||
$result->next();
|
||||
$row = $result->getRow();
|
||||
|
||||
|
||||
while ($row = $result->getRow()) {
|
||||
if ((trim( $pProUid ) == trim( $row[1] )) && ($row[2] == 'mysql')) {
|
||||
$connections[] = Array ('DBS_UID' => $row[0],'DBS_NAME' => '[' . $row[3] . '] ' . $row[2] . ': ' . $row[4]
|
||||
@@ -335,7 +335,12 @@ class dbConnections
|
||||
);
|
||||
break;
|
||||
case 'oracle':
|
||||
$encodes = Array ();
|
||||
$encodes = array (
|
||||
array ("UTF8", "UTF8 - Unicode 3.0 UTF-8 Universal character set CESU-8 compliant"),
|
||||
array ("UTFE", "UTFE - EBCDIC form of Unicode 3.0 UTF-8 Universal character set"),
|
||||
array ("AL16UTF16", "AL16UTF16 - Unicode 3.1 UTF-16 Universal character set"),
|
||||
array ("AL32UTF8", "AL32UTF8 - Unicode 3.1 UTF-8 Universal character set")
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ class NET
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function tryConnectServer($pDbDriver, array $arrayServerData = array())
|
||||
public function tryConnectServer($pDbDriver, array $arrayServerData = array(), $dbsEncode = "")
|
||||
{
|
||||
G::LoadSystem('inputfilter');
|
||||
$filter = new InputFilter();
|
||||
@@ -224,8 +224,8 @@ class NET
|
||||
if ($arrayServerData["connectionType"] == "TNS" || $arrayServerData["DBS_TYPEORACLE"] == "TNS") {
|
||||
$flagTns=1;
|
||||
}else{
|
||||
$flagTns=0;
|
||||
}
|
||||
$flagTns=0;
|
||||
}
|
||||
}else{
|
||||
$flagTns=0;
|
||||
}
|
||||
@@ -291,9 +291,9 @@ class NET
|
||||
if ($flagTns == 0) {
|
||||
$this->db_port = ($this->db_port == "" || $this->db_port == 0)? "1521" : $this->db_port;
|
||||
|
||||
$cnn = @oci_connect($this->db_user, $this->db_passwd, "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP) (HOST=$this->ip) (PORT=$this->db_port) )) (CONNECT_DATA=(SERVICE_NAME=$this->db_sourcename)))");
|
||||
$cnn = @oci_connect($this->db_user, $this->db_passwd, "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP) (HOST=$this->ip) (PORT=$this->db_port) )) (CONNECT_DATA=(SERVICE_NAME=$this->db_sourcename)))", $dbsEncode);
|
||||
} else {
|
||||
$cnn = @oci_connect($this->db_user, $this->db_passwd, $arrayServerData["tns"]);
|
||||
$cnn = @oci_connect($this->db_user, $this->db_passwd, $arrayServerData["tns"], $dbsEncode);
|
||||
}
|
||||
|
||||
if ($cnn) {
|
||||
@@ -329,7 +329,7 @@ class NET
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function tryOpenDataBase($pDbDriver, array $arrayServerData = array())
|
||||
public function tryOpenDataBase($pDbDriver, array $arrayServerData = array(), $dbsEncode = "")
|
||||
{
|
||||
G::LoadSystem('inputfilter');
|
||||
$filter = new InputFilter();
|
||||
@@ -349,8 +349,8 @@ class NET
|
||||
if ($arrayServerData["connectionType"] == "TNS" || $arrayServerData["DBS_TYPEORACLE"] == "TNS") {
|
||||
$flagTns=1;
|
||||
}else{
|
||||
$flagTns=0;
|
||||
}
|
||||
$flagTns=0;
|
||||
}
|
||||
}else{
|
||||
$flagTns=0;
|
||||
}
|
||||
@@ -434,9 +434,9 @@ class NET
|
||||
if ($flagTns == 0) {
|
||||
$this->db_port = ($this->db_port == "" || $this->db_port == 0)? "1521" : $this->db_port;
|
||||
|
||||
$cnn = @oci_connect($this->db_user, $this->db_passwd, "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP) (HOST=$this->ip) (PORT=$this->db_port) )) (CONNECT_DATA=(SERVICE_NAME=$this->db_sourcename)))");
|
||||
$cnn = @oci_connect($this->db_user, $this->db_passwd, "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP) (HOST=$this->ip) (PORT=$this->db_port) )) (CONNECT_DATA=(SERVICE_NAME=$this->db_sourcename)))", $dbsEncode);
|
||||
} else {
|
||||
$cnn = @oci_connect($this->db_user, $this->db_passwd, $arrayServerData["tns"]);
|
||||
$cnn = @oci_connect($this->db_user, $this->db_passwd, $arrayServerData["tns"], $dbsEncode);
|
||||
}
|
||||
|
||||
if ($cnn) {
|
||||
@@ -592,4 +592,3 @@ class Stat
|
||||
$this->status = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -242,6 +242,7 @@ function executeQuery ($SqlStatement, $DBConnectionUID = 'workflow', $aParameter
|
||||
{
|
||||
$con = Propel::getConnection( $DBConnectionUID );
|
||||
$con->begin();
|
||||
|
||||
try {
|
||||
$statement = trim( $SqlStatement );
|
||||
$statement = str_replace( '(', '', $statement );
|
||||
@@ -278,7 +279,13 @@ function executeQuery ($SqlStatement, $DBConnectionUID = 'workflow', $aParameter
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$result = executeQueryOci( $SqlStatement, $con, $aParameter );
|
||||
$dataEncode = $con->getDSN();
|
||||
|
||||
if (isset($dataEncode["encoding"]) && $dataEncode["encoding"] != "") {
|
||||
$result = executeQueryOci($SqlStatement, $con, $aParameter, $dataEncode["encoding"]);
|
||||
} else {
|
||||
$result = executeQueryOci($SqlStatement, $con, $aParameter);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
@@ -493,7 +493,7 @@ class PMScript
|
||||
$sScript .= substr( $this->sScript, $iAux );
|
||||
if(preg_match('/\b(or|and|xor)\b/i' , $sScript)) {
|
||||
$sScript = "( ".$sScript." )";
|
||||
}
|
||||
}
|
||||
$sScript = '$bResult = ' . $sScript . ';';
|
||||
// checks if the syntax is valid or if the variables in that condition has been previously defined
|
||||
if ($this->validSyntax( $sScript ) && $variableIsDefined) {
|
||||
@@ -695,7 +695,7 @@ function getEngineDataBaseName ($connection)
|
||||
* @param type $sql
|
||||
* @param type $connection
|
||||
*/
|
||||
function executeQueryOci ($sql, $connection, $aParameter = array())
|
||||
function executeQueryOci ($sql, $connection, $aParameter = array(), $dbsEncode = "")
|
||||
{
|
||||
$aDNS = $connection->getDSN();
|
||||
|
||||
@@ -710,12 +710,12 @@ function executeQueryOci ($sql, $connection, $aParameter = array())
|
||||
|
||||
if ($flagTns == 0) {
|
||||
// if not default port
|
||||
$conn = oci_connect($sUsername, $sPassword, $sHostspec . ":" . $sPort . "/" . $sDatabse);
|
||||
$conn = oci_connect($sUsername, $sPassword, $sHostspec . ":" . $sPort . "/" . $sDatabse, $dbsEncode);
|
||||
} else {
|
||||
$conn = oci_connect($sUsername, $sPassword, $sHostspec);
|
||||
$conn = oci_connect($sUsername, $sPassword, $sHostspec, $dbsEncode);
|
||||
}
|
||||
} else {
|
||||
$conn = oci_connect( $sUsername, $sPassword, $sHostspec . "/" . $sDatabse );
|
||||
$conn = oci_connect( $sUsername, $sPassword, $sHostspec . "/" . $sDatabse, $dbsEncode);
|
||||
}
|
||||
|
||||
if (! $conn) {
|
||||
@@ -786,4 +786,3 @@ function executeQueryOci ($sql, $connection, $aParameter = array())
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user