fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [7341] API: Oracle support


From: Sigurd Nes
Subject: [Fmsystem-commits] [7341] API: Oracle support
Date: Sun, 05 Jun 2011 21:43:49 +0000

Revision: 7341
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7341
Author:   sigurdne
Date:     2011-06-05 21:43:48 +0000 (Sun, 05 Jun 2011)
Log Message:
-----------
API: Oracle support

Modified Paths:
--------------
    trunk/phpgwapi/inc/class.db_pdo.inc.php
    trunk/phpgwapi/inc/class.js.inc.php
    trunk/phpgwapi/inc/class.schema_proc.inc.php
    trunk/phpgwapi/inc/class.setup_process.inc.php
    trunk/phpgwapi/setup/tables_current.inc.php

Modified: trunk/phpgwapi/inc/class.db_pdo.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.db_pdo.inc.php     2011-06-05 20:46:36 UTC (rev 
7340)
+++ trunk/phpgwapi/inc/class.db_pdo.inc.php     2011-06-05 21:43:48 UTC (rev 
7341)
@@ -308,7 +308,7 @@
                */
                public function query($sql, $line = '', $file = '', $exec = 
false, $fetch_single = false)
                {
-
+//_Debug_Array($sql);
                        $this->_get_fetchmode();
                        $this->fetch_single = $fetch_single;
 
@@ -319,7 +319,7 @@
 
                        if(!$exec)
                        {
-                               if(preg_match('/(^INSERT INTO|^DELETE 
FROM|^CREATE TABLE|^DROP TABLE|^ALTER TABLE|^UPDATE)/i', $sql)) // need it for 
MySQL
+                               if(preg_match('/(^INSERT INTO|^DELETE 
FROM|^CREATE|^DROP|^ALTER|^UPDATE)/i', $sql)) // need it for MySQL and Oracle
                                {
                                        $exec = true;
                                }
@@ -564,18 +564,22 @@
                public function transaction_abort()
                {
                        $ret = false;
-                       $this->Transaction = false;
-                       try
+
+                       if($this->Transaction)
                        {
-                               $ret = $this->db->rollBack();
-                       }
-                       catch(PDOException $e)
-                       {
-                               if ( $e )
+                               $this->Transaction = false;
+                               try
                                {
-                                       trigger_error('Error: ' . 
$e->getMessage(), E_USER_ERROR);
-       //                              throw $e;
+                                       $ret = $this->db->rollBack();
                                }
+                               catch(PDOException $e)
+                               {
+                                       if ( $e )
+                                       {
+                                               trigger_error('Error: ' . 
$e->getMessage(), E_USER_ERROR);
+       //                                      throw $e;
+                                       }
+                               }
                        }
                        return $ret;
                }

Modified: trunk/phpgwapi/inc/class.js.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.js.inc.php 2011-06-05 20:46:36 UTC (rev 7340)
+++ trunk/phpgwapi/inc/class.js.inc.php 2011-06-05 21:43:48 UTC (rev 7341)
@@ -118,7 +118,7 @@
                */
                public function get_script_links()
                {
-                       $combine = true;
+                       $combine = false;
                        if(ini_get('suhosin.get.max_value_length') && 
ini_get('suhosin.get.max_value_length') < 2000)
                        {
                                $combine = false;

Modified: trunk/phpgwapi/inc/class.schema_proc.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.schema_proc.inc.php        2011-06-05 20:46:36 UTC 
(rev 7340)
+++ trunk/phpgwapi/inc/class.schema_proc.inc.php        2011-06-05 21:43:48 UTC 
(rev 7341)
@@ -482,29 +482,42 @@
                        {
                                if($bNullable == False)
                                {
-                                       //$sBufNullable = ' NOT NULL';
-                                       $sFieldSQL .= ' NOT NULL';
+                                       $sBufNullable = ' NOT NULL';
+                                       //$sFieldSQL .= ' NOT NULL';
                                }
                                else
                                {
-                                       $sFieldSQL .= ' NULL';
+                                       $sBufNullable = ' NULL';
+                                       //$sFieldSQL .= ' NULL';
                                }
                                
                                if($sDefault === '0' || $sDefault === 0)
                                {
-                                       $sFieldSQL .= ' DEFAULT 0';
+                                       $sBufDefault = ' DEFAULT 0';
+                                       //$sFieldSQL .= ' DEFAULT 0';
                                }                                               
                
                                elseif(!is_numeric($sDefault) && $sDefault != 
'')
                                {
                                        if($DEBUG) { echo '<br>_GetFieldSQL(): 
Calling TranslateDefault for "' . $sDefault . '"'; }
                                        // Get default DDL - useful for 
differences in date defaults (eg, now() vs. getdate())
                                        $sTranslatedDefault = 
$this->m_oTranslator->TranslateDefault($sDefault);
-                                       $sFieldSQL .= " DEFAULT 
$sTranslatedDefault";
+                                       $sBufDefault = " DEFAULT 
$sTranslatedDefault";
+                                       //$sFieldSQL .= " DEFAULT 
$sTranslatedDefault";
                                }
                                elseif($sDefault)
                                {
-                                       $sFieldSQL .= " DEFAULT $sDefault";
+                                       $sBufDefault .= " DEFAULT $sDefault";
+                                       //$sFieldSQL .= " DEFAULT $sDefault";
                                }
+                               
+                               if($this->dbms == 'oracle')
+                               {
+                                       $sFieldSQL .= 
"{$sBufDefault}{$sBufNullable}";
+                               }
+                               else
+                               {
+                                       $sFieldSQL .= 
"{$sBufNullable}{$sBufDefault}";
+                               }
                                if($DEBUG) { echo '<br>_GetFieldSQL(): Outgoing 
SQL:   ' . $sFieldSQL; }
                                return true;
                        }

Modified: trunk/phpgwapi/inc/class.setup_process.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.setup_process.inc.php      2011-06-05 20:46:36 UTC 
(rev 7340)
+++ trunk/phpgwapi/inc/class.setup_process.inc.php      2011-06-05 21:43:48 UTC 
(rev 7341)
@@ -259,6 +259,7 @@
                        }
                        $GLOBALS['phpgw_setup']->oProc->m_bDeltaOnly = False;
 
+                       
$GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
                        if ( !is_array($setup_info) )
                        {
                                $setup_info = array();
@@ -329,7 +330,7 @@
                                }
                                if($DEBUG) { echo '<br>process->current(): 
Outgoing status: ' . $appname . ',status: '. $setup_info[$key]['status']; }
                        }
-
+                       
$GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
                        /* Done, return current status */
                        return ($setup_info);
                }

Modified: trunk/phpgwapi/setup/tables_current.inc.php
===================================================================
--- trunk/phpgwapi/setup/tables_current.inc.php 2011-06-05 20:46:36 UTC (rev 
7340)
+++ trunk/phpgwapi/setup/tables_current.inc.php 2011-06-05 21:43:48 UTC (rev 
7341)
@@ -276,7 +276,7 @@
                                'owner_id' => array('type' => 'int','precision' 
=> 4,'nullable' => False),
                                'createdby_id' => array('type' => 
'int','precision' => 4,'nullable' => True),
                                'modifiedby_id' => array('type' => 
'int','precision' => 4,'nullable' => True),
-                               'created' => array('type' => 'date','nullable' 
=> False,'default' => '1970-01-01'),
+                               'created' => array('type' => 'date','nullable' 
=> False,'default' => 'current_date'),
                                'modified' => array('type' => 'date','nullable' 
=> True),
                                'size' => array('type' => 'int','precision' => 
4,'nullable' => True),
                                'mime_type' => array('type' => 
'varchar','precision' => '150','nullable' => True),




reply via email to

[Prev in Thread] Current Thread [Next in Thread]