phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: setup/inc class.schema_proc.inc.php,1.3.2.1,1.3


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: setup/inc class.schema_proc.inc.php,1.3.2.1,1.3.2.2 class.setup_process.inc.php,1.8.2.3,1.8.2.4
Date: Mon, 17 Mar 2003 16:44:28 -0500

Update of /cvsroot/phpgroupware/setup/inc
In directory subversions:/tmp/cvs-serv6786

Modified Files:
      Tag: Version-0_9_14-branch
        class.schema_proc.inc.php class.setup_process.inc.php 
Log Message:
enabled error-messages on table-creation, error had been silently ignored before

Index: class.schema_proc.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/setup/inc/Attic/class.schema_proc.inc.php,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -C2 -r1.3.2.1 -r1.3.2.2
*** class.schema_proc.inc.php   11 Apr 2002 14:11:05 -0000      1.3.2.1
--- class.schema_proc.inc.php   17 Mar 2003 21:44:26 -0000      1.3.2.2
***************
*** 31,35 ****
                }
  
!               function GenerateScripts($aTables, $bOutputHTML = false)
                {
                        if (!is_array($aTables))
--- 31,38 ----
                }
  
!               /*!
!               @param $bOutputHTML: 0 = no output, 1 = only errors, 2 = all 
messages
!               */
!               function GenerateScripts($aTables, $bOutputHTML = 0)
                {
                        if (!is_array($aTables))
***************
*** 45,49 ****
                        {
                                $sSequenceSQL = '';
!                               if ($this->_GetTableSQL($sTableName, 
$aTableDef, $sTableSQL, $sSequenceSQL))
                                {
                                        $sTableSQL = "CREATE TABLE $sTableName 
(\n$sTableSQL\n)"
--- 48,52 ----
                        {
                                $sSequenceSQL = '';
!                               if ($this->_GetTableSQL($sTableName, 
$aTableDef, $sTableSQL, $sSequenceSQL,$bOutputHTML))
                                {
                                        $sTableSQL = "CREATE TABLE $sTableName 
(\n$sTableSQL\n)"
***************
*** 57,61 ****
                                else
                                {
!                                       if ($bOutputHTML)
                                        {
                                                print('<br>Failed generating 
script for <b>' . $sTableName . '</b><br>');
--- 60,64 ----
                                else
                                {
!                                       if ($bOutputHTML >= 1)
                                        {
                                                print('<br>Failed generating 
script for <b>' . $sTableName . '</b><br>');
***************
*** 66,70 ****
                        }
  
!                       if ($bOutputHTML)
                        {
                                print('<pre>' . $sAllTableSQL . 
'</pre><br><br>');
--- 69,73 ----
                        }
  
!                       if ($bOutputHTML >= 2)
                        {
                                print('<pre>' . $sAllTableSQL . 
'</pre><br><br>');
***************
*** 74,78 ****
                }
  
!               function ExecuteScripts($aTables, $bOutputHTML = false)
                {
                        if (!is_array($aTables) || !IsSet($this->m_odb))
--- 77,81 ----
                }
  
!               function ExecuteScripts($aTables, $bOutputHTML = 0)
                {
                        if (!is_array($aTables) || !IsSet($this->m_odb))
***************
*** 88,92 ****
                                if ($this->CreateTable($sTableName, $aTableDef))
                                {
!                                       if ($bOutputHTML)
                                        {
                                                echo '<br>Create Table <b>' . 
$sTableName . '</b>';
--- 91,95 ----
                                if ($this->CreateTable($sTableName, $aTableDef))
                                {
!                                       if ($bOutputHTML >= 2)
                                        {
                                                echo '<br>Create Table <b>' . 
$sTableName . '</b>';
***************
*** 95,99 ****
                                else
                                {
!                                       if ($bOutputHTML)
                                        {
                                                echo '<br>Create Table Failed 
For <b>' . $sTableName . '</b>';
--- 98,102 ----
                                else
                                {
!                                       if ($bOutputHTML >= 1)
                                        {
                                                echo '<br>Create Table Failed 
For <b>' . $sTableName . '</b>';
***************
*** 107,111 ****
                }
  
!               function DropAllTables($aTables, $bOutputHTML = false)
                {
                        if (!is_array($aTables) || !IsSet($this->m_odb))
--- 110,114 ----
                }
  
!               function DropAllTables($aTables, $bOutputHTML = 0)
                {
                        if (!is_array($aTables) || !IsSet($this->m_odb))
***************
*** 121,125 ****
                                if ($this->DropTable($sTableName))
                                {
!                                       if ($bOutputHTML)
                                        {
                                                echo '<br>Drop Table <b>' . 
$sTableSQL . '</b>';
--- 124,128 ----
                                if ($this->DropTable($sTableName))
                                {
!                                       if ($bOutputHTML >= 2)
                                        {
                                                echo '<br>Drop Table <b>' . 
$sTableSQL . '</b>';
***************
*** 256,260 ****
                }
  
!               function _GetTableSQL($sTableName, $aTableDef, &$sTableSQL, 
&$sSequenceSQL)
                {
                        global $DEBUG;
--- 259,263 ----
                }
  
!               function _GetTableSQL($sTableName, $aTableDef, &$sTableSQL, 
&$sSequenceSQL,$bOutputHTML=0)
                {
                        global $DEBUG;
***************
*** 270,274 ****
                        {
                                $sFieldSQL = '';
!                               if ($this->_GetFieldSQL($aFieldAttr, 
$sFieldSQL))
                                {
                                        if ($sTableSQL != '')
--- 273,277 ----
                        {
                                $sFieldSQL = '';
!                               if ($this->_GetFieldSQL($aFieldAttr, 
$sFieldSQL, $bOutputHTML))
                                {
                                        if ($sTableSQL != '')
***************
*** 290,294 ****
                                else
                                {
!                                       if ($DEBUG) { echo 'GetFieldSQL failed 
for ' . $sFieldName; }
                                        return false;
                                }
--- 293,297 ----
                                else
                                {
!                                       if ($DEBUG || $bOutputHTML) { echo 
'GetFieldSQL failed for ' . $sFieldName; }
                                        return false;
                                }
***************
*** 302,306 ****
                                if (!$this->_GetPK($aTableDef['pk'], $sPKSQL))
                                {
!                                       if ($bOutputHTML)
                                        {
                                                print('<br>Failed getting 
primary key<br>');
--- 305,309 ----
                                if (!$this->_GetPK($aTableDef['pk'], $sPKSQL))
                                {
!                                       if ($DEBUG || $bOutputHTML)
                                        {
                                                print('<br>Failed getting 
primary key<br>');
***************
*** 315,319 ****
                                if (!$this->_GetUC($aTableDef['uc'], $sUCSQL))
                                {
!                                       if ($bOutputHTML)
                                        {
                                                print('<br>Failed getting 
unique constraint<br>');
--- 318,322 ----
                                if (!$this->_GetUC($aTableDef['uc'], $sUCSQL))
                                {
!                                       if ($DEBUG || $bOutputHTML)
                                        {
                                                print('<br>Failed getting 
unique constraint<br>');
***************
*** 333,345 ****
                                $sTableSQL .= ",\n" . $sUCSQL;
                        }
- 
                        return true;
                }
  
                // Get field DDL
!               function _GetFieldSQL($aField, &$sFieldSQL)
                {
                        global $DEBUG;
!                       if ($DEBUG) { echo'<br>_GetFieldSQL(): Incoming ARRAY: 
'; var_dump($aField); }
                        if (!is_array($aField))
                        {
--- 336,347 ----
                                $sTableSQL .= ",\n" . $sUCSQL;
                        }
                        return true;
                }
  
                // Get field DDL
!               function _GetFieldSQL($aField, &$sFieldSQL, $bOutputHTML=0)
                {
                        global $DEBUG;
!                       if ($DEBUG || $bOutputHTML >= 2) { 
echo'<br>_GetFieldSQL(): Incoming ARRAY: '; var_dump($aField); }
                        if (!is_array($aField))
                        {
***************
*** 369,373 ****
                                        case 'default':
                                                $sDefault = $vAttrVal;
!                                               if ($DEBUG) { 
echo'<br>_GetFieldSQL(): Default="' . $sDefault . '"'; }
                                                break;
                                        case 'nullable':
--- 371,375 ----
                                        case 'default':
                                                $sDefault = $vAttrVal;
!                                               if ($DEBUG || $bOutputHTML >= 
2) { echo'<br>_GetFieldSQL(): Default="' . $sDefault . '"'; }
                                                break;
                                        case 'nullable':
***************
*** 387,391 ****
                                if ($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);
--- 389,393 ----
                                if ($sDefault != '')
                                {
!                                       if ($DEBUG || $bOutputHTML >= 2) { 
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);
***************
*** 396,404 ****
                                        $sFieldSQL .= " DEFAULT '0'";
                                }
!                               if ($DEBUG) { echo'<br>_GetFieldSQL(): Outgoing 
SQL:   ' . $sFieldSQL; }
                                return true;
                        }
  
!                       if ($DEBUG) { echo '<br>Failed to translate field: 
type[' . $sType . '] precision[' . $iPrecision . '] scale[' . $iScale . 
']<br>'; }
  
                        return false;
--- 398,406 ----
                                        $sFieldSQL .= " DEFAULT '0'";
                                }
!                               if ($DEBUG || $bOutputHTML >= 2) { 
echo'<br>_GetFieldSQL(): Outgoing SQL:   ' . $sFieldSQL; }
                                return true;
                        }
  
!                       if ($DEBUG || $bOutputHTML) { echo '<br>Failed to 
translate field: type[' . $sType . '] precision[' . $iPrecision . '] scale[' . 
$iScale . ']<br>'; }
  
                        return false;

Index: class.setup_process.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/setup/inc/Attic/class.setup_process.inc.php,v
retrieving revision 1.8.2.3
retrieving revision 1.8.2.4
diff -C2 -r1.8.2.3 -r1.8.2.4
*** class.setup_process.inc.php 19 Dec 2002 22:37:21 -0000      1.8.2.3
--- class.setup_process.inc.php 17 Mar 2003 21:44:26 -0000      1.8.2.4
***************
*** 475,479 ****
                                        }
                                        include 
($appdir.'tables_baseline.inc.php');
!                                       
$this->oProc->GenerateScripts($phpgw_baseline, $DEBUG);
                                        
$this->post_process($phpgw_baseline,$DEBUG);
  
--- 475,479 ----
                                        }
                                        include 
($appdir.'tables_baseline.inc.php');
!                                       
$this->oProc->GenerateScripts($phpgw_baseline, $DEBUG ? 2 : 1);
                                        
$this->post_process($phpgw_baseline,$DEBUG);
  
***************
*** 564,572 ****
                                                include 
($appdir.'tables_baseline.inc.php');
                                                $this->oProc->m_aTables = 
$phpgw_baseline;
!                                               /* 
$this->oProc->GenerateScripts($phpgw_baseline, $DEBUG); */
                                        }
                                        else
                                        {
!                                               if ($DEBUG)
                                                {
                                                        echo 
'<br>process_baseline(): No baseline tables for ' . $appname . "\n";
--- 564,572 ----
                                                include 
($appdir.'tables_baseline.inc.php');
                                                $this->oProc->m_aTables = 
$phpgw_baseline;
!                                               /* 
$this->oProc->GenerateScripts($phpgw_baseline, $DEBUG ? 2 : 1); */
                                        }
                                        else
                                        {
!                                               //always show the error if 
($DEBUG)
                                                {
                                                        echo 
'<br>process_baseline(): No baseline tables for ' . $appname . "\n";
***************
*** 696,700 ****
                                                        $appstatus  = 'F';
  
!                                                       if ($DEBUG)
                                                        {
                                                                echo 
'<br>process_upgrade(): No table upgrade available for ' . $appname . "\n";
--- 696,700 ----
                                                        $appstatus  = 'F';
  
!                                                       //always show the error 
if ($DEBUG)
                                                        {
                                                                echo 
'<br>process_upgrade(): No table upgrade available for ' . $appname . "\n";
***************
*** 755,762 ****
                        }
  
!                       $ret = $this->oProc->GenerateScripts($tables,$DEBUG);
                        if ($ret)
                        {
!                               $oret = 
$this->oProc->ExecuteScripts($tables,$DEBUG);
                                if ($oret)
                                {
--- 755,762 ----
                        }
  
!                       $ret = $this->oProc->GenerateScripts($tables,$DEBUG ? 2 
: 1);
                        if ($ret)
                        {
!                               $oret = 
$this->oProc->ExecuteScripts($tables,$DEBUG ? 2 : 1);
                                if ($oret)
                                {





reply via email to

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