/[phpcompta]/phpcompta/html/admin/setup.php
ViewVC logotype

Diff of /phpcompta/html/admin/setup.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.36 by sparkyx, Sun Oct 30 19:42:52 2005 UTC revision 1.37 by sparkyx, Sun Oct 30 21:16:44 2005 UTC
# Line 112  function ExecuteScript($p_cn,$script) { Line 112  function ExecuteScript($p_cn,$script) {
112              //echo "Blank $buffer";              //echo "Blank $buffer";
113        Continue;        Continue;
114      }      }
115      if ( strpos($buffer,"create function")===0 ) {      if ( strpos(strtolower($buffer),"create function")===0 ) {
116              echo "found a function";              echo "found a function";
117              $flag_function=true;              $flag_function=true;
118              $sql=$buffer;              $sql=$buffer;
# Line 124  function ExecuteScript($p_cn,$script) { Line 124  function ExecuteScript($p_cn,$script) {
124        continue;        continue;
125      }      }
126      if ( $flag_function ) {      if ( $flag_function ) {
127              if ( strpos($buffer, "language plpgsql") == false ) {        if ( strpos(strtolower($buffer), "language plpgsql") == false ) {
128                  $sql.=$buffer;                  $sql.=$buffer;
129                  continue;                  continue;
130              }              }
# Line 135  function ExecuteScript($p_cn,$script) { Line 135  function ExecuteScript($p_cn,$script) {
135      $sql.=$buffer;      $sql.=$buffer;
136      if ( ExecSql($p_cn,$sql) == false ) {      if ( ExecSql($p_cn,$sql) == false ) {
137              Rollback($p_cn);              Rollback($p_cn);
138                if ( DEBUG=='false' ) ob_end_flush();
139              print "ERROR : $sql";              print "ERROR : $sql";
140              break;              exit();
141              }              }
142      $sql="";      $sql="";
143      $flag_function=false;      $flag_function=false;
# Line 164  foreach (array('magic_quotes_gpc','magic Line 165  foreach (array('magic_quotes_gpc','magic
165    }    }
166    
167  }  }
168    if ( ini_get("max_execution_time") < 60 )  {
169            print '<h2 class="info"> max_execution_time should be set to 60 minimum</h2>';
170    }
171  if ( ini_get("session.auto_start") == false )  {  if ( ini_get("session.auto_start") == false )  {
172          print '<h2 class="error"> session.auto_start must be set to true </h2>';          print '<h2 class="error"> session.auto_start must be set to true </h2>';
173          $flag_php++;          $flag_php++;
# Line 339  for ($e=0;$e < $MaxDossier;$e++) { Line 343  for ($e=0;$e < $MaxDossier;$e++) {
343    $db_row=pg_fetch_array($Resdossier,$e);    $db_row=pg_fetch_array($Resdossier,$e);
344    $db=DbConnect($db_row['dos_id'],'dossier');    $db=DbConnect($db_row['dos_id'],'dossier');
345    echo "Patching ".$db_row['dos_name']." from the version ".GetVersion($db)."<hr>";    echo "Patching ".$db_row['dos_name']." from the version ".GetVersion($db)."<hr>";
346    if ( DEBUG=='false' ) ob_start();
347    if ( GetVersion($db) <= 4 ) {    if ( GetVersion($db) <= 4 ) {
348      ExecuteScript($db,'sql/patch/upgrade4.sql');      ExecuteScript($db,'sql/patch/upgrade4.sql');
349                
# Line 383  for ($e=0;$e < $MaxDossier;$e++) { Line 387  for ($e=0;$e < $MaxDossier;$e++) {
387        ExecSql($db,"select setval('s_grpt',$M,true)");        ExecSql($db,"select setval('s_grpt',$M,true)");
388      }      }
389    } // version == 7    } // version == 7
390    if ( DEBUG == 'false') ob_end_clean();
391   }   }//for
392    
393  $Resdossier=ExecSql($cn,"select mod_id, mod_name from modeledef");  $Resdossier=ExecSql($cn,"select mod_id, mod_name from modeledef");
394  $MaxDossier=pg_NumRows($Resdossier);  $MaxDossier=pg_NumRows($Resdossier);
# Line 393  for ($e=0;$e < $MaxDossier;$e++) { Line 397  for ($e=0;$e < $MaxDossier;$e++) {
397    $db_row=pg_fetch_array($Resdossier,$e);    $db_row=pg_fetch_array($Resdossier,$e);
398    echo "Patching ".$db_row['mod_name']."<hr>";    echo "Patching ".$db_row['mod_name']."<hr>";
399    $db=DbConnect($db_row['mod_id'],'mod');    $db=DbConnect($db_row['mod_id'],'mod');
400    if (DEBUG == 'false' ) ob_start();
401    if ( GetVersion($db) <= 4 ) {    if ( GetVersion($db) <= 4 ) {
402      ExecuteScript($db,'sql/patch/upgrade4.sql');      ExecuteScript($db,'sql/patch/upgrade4.sql');
403                
# Line 432  for ($e=0;$e < $MaxDossier;$e++) { Line 437  for ($e=0;$e < $MaxDossier;$e++) {
437        ExecSql($db,"select setval('s_grpt',$M,true)");        ExecSql($db,"select setval('s_grpt',$M,true)");
438      }      }
439    } // version == 7    } // version == 7
440    if ( DEBUG == 'false') ob_end_clean();
441   }   }
442    
443  echo "Upgrading Repository";  echo "Upgrading Repository";
444  $cn=DbConnect();  $cn=DbConnect();
445    if ( DEBUG == 'false') ob_start();
446  if ( GetVersion($cn) <= 4 ) {  if ( GetVersion($cn) <= 4 ) {
447    ExecuteScript($cn,'sql/patch/ac-upgrade4.sql');    ExecuteScript($cn,'sql/patch/ac-upgrade4.sql');
448   }   }
# Line 446  if ( GetVersion($cn) == 5 ) { Line 452  if ( GetVersion($cn) == 5 ) {
452  if ( GetVersion($cn) == 6 ) {  if ( GetVersion($cn) == 6 ) {
453    ExecuteScript($cn,'sql/patch/ac-upgrade6.sql');    ExecuteScript($cn,'sql/patch/ac-upgrade6.sql');
454   }   }
455    if (DEBUG=='false') ob_end_clean();
456    echo "<h2 class=\"info\">Voilà tout est installé ;-)</h2>";

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26