From fee715929e05eef615f47ebcda0e0abdc535ea15 Mon Sep 17 00:00:00 2001 From: Brayan Osmar Pereyra Suxo Date: Tue, 9 Sep 2014 12:17:14 -0400 Subject: [PATCH 1/3] Coreccion de dbAdapter --- workflow/engine/classes/class.wsTools.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/workflow/engine/classes/class.wsTools.php b/workflow/engine/classes/class.wsTools.php index 5b3585a53..5ac7bd598 100755 --- a/workflow/engine/classes/class.wsTools.php +++ b/workflow/engine/classes/class.wsTools.php @@ -686,11 +686,12 @@ class workspaceTools { G::LoadClass("patch"); $this->initPropel( true ); + p11835::$dbAdapter = $this->dbAdapter; p11835::isApplicable(); - $systemSchema = System::getSystemSchema(); - $systemSchemaRbac = System::getSystemSchemaRbac();// obtiene el Schema de Rbac + $systemSchema = System::getSystemSchema($this->dbAdapter); + $systemSchemaRbac = System::getSystemSchemaRbac($this->dbAdapter);// get the Rbac Schema $this->upgradeSchema( $systemSchema ); - $this->upgradeSchema( $systemSchemaRbac, false, true, $onedb ); // Hace Upgrade de Rbac + $this->upgradeSchema( $systemSchemaRbac, false, true, $onedb ); // perform Upgrade to Rbac $this->upgradeData(); p11835::execute(); return true; @@ -735,7 +736,7 @@ class workspaceTools if ($changed) { return $changes; } else { - CLI::logging("-> Nothing to change in the data base structure (" . ($rbac ? 'RBAC' : 'WORKFLOW') . ")\n"); + CLI::logging("-> Nothing to change in the data base structure of " . (($rbac == true)?"RBAC":"WORKFLOW") . "\n"); return $changed; } } From e10a4589945dd8e389cabe717abbd8e8b89b666c Mon Sep 17 00:00:00 2001 From: Brayan Osmar Pereyra Suxo Date: Tue, 9 Sep 2014 12:34:49 -0400 Subject: [PATCH 2/3] Correccion de dbAdapter --- workflow/engine/classes/class.wsTools.php | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/workflow/engine/classes/class.wsTools.php b/workflow/engine/classes/class.wsTools.php index 5ac7bd598..5c07f97e0 100755 --- a/workflow/engine/classes/class.wsTools.php +++ b/workflow/engine/classes/class.wsTools.php @@ -697,6 +697,23 @@ class workspaceTools return true; } + private function setFormatRows() + { + switch ($this->dbAdapter) { + case 'mysql': + $this->assoc = MYSQL_ASSOC; + $this->num = MYSQL_NUM; + break; + case 'sqlsrv': + $this->assoc = SQLSRV_FETCH_ASSOC; + $this->num = SQLSRV_FETCH_NUMERIC; + break; + default: + throw new Exception("Unknown adapter hae been set for associate fetch index row format."); + break; + } + } + /** * Upgrade this workspace database from a schema * @@ -713,12 +730,14 @@ class workspaceTools throw new Exception("Only MySQL is supported"); } + $this->setFormatRows(); + $workspaceSchema = $this->getSchema($rbac); $oDataBase = $this->getDatabase($rbac); if (!$onedb) { - if($rbac){ + if($rbac){ $rename = System::verifyRbacSchema($workspaceSchema); if (count($rename) > 0) { foreach ($rename as $tableName) { @@ -741,7 +760,7 @@ class workspaceTools } } - $oDataBase->iFetchType = MYSQL_NUM; + $oDataBase->iFetchType = $this->num; $oDataBase->logQuery(count($changes)); From 5939a8a0f484d3a89fe1fbf82c116a607b18f569 Mon Sep 17 00:00:00 2001 From: Brayan Osmar Pereyra Suxo Date: Tue, 9 Sep 2014 14:17:08 -0400 Subject: [PATCH 3/3] Adicion de dbAdapter en patch --- workflow/engine/classes/class.patch.php | 1 + 1 file changed, 1 insertion(+) diff --git a/workflow/engine/classes/class.patch.php b/workflow/engine/classes/class.patch.php index 4a5ce313c..75b39fa10 100644 --- a/workflow/engine/classes/class.patch.php +++ b/workflow/engine/classes/class.patch.php @@ -12,6 +12,7 @@ G::LoadClass("TaskUser"); abstract class patch { static protected $isPathchable = false; + static public $dbAdapter = 'mysql'; abstract static public function isApplicable(); abstract static public function execute(); }