install/upgrade.php
changeset 418 322fa0c91303
parent 411 d1a95497b68f
child 436 242353360e37
equal deleted inserted replaced
417:b76ebe229548 418:322fa0c91303
   232     foreach ( $sql_list as $sql )
   232     foreach ( $sql_list as $sql )
   233     {
   233     {
   234       if ( !$db->sql_query($sql) )
   234       if ( !$db->sql_query($sql) )
   235         $db->_die();
   235         $db->_die();
   236     }
   236     }
       
   237     
       
   238     // Is there an additional script (logic) to be run after the schema?
       
   239     $postscript = ENANO_ROOT . "/install/schemas/upgrade/{$verset[0]}-{$verset[1]}.php";
       
   240     if ( file_exists($postscript) )
       
   241       @include($postscript);
       
   242     
       
   243     // The advantage of calling setConfig on the system version here?
       
   244     // Simple. If the upgrade fails, it will pick up from the last
       
   245     // version, not try to start again from the beginning. This will
       
   246     // still cause errors in most cases though. Eventually we probably
       
   247     // need some sort of query-numbering system that tracks in-progress
       
   248     // upgrades.
       
   249     
   237     setConfig('enano_version', $verset[1]);
   250     setConfig('enano_version', $verset[1]);
   238   }
   251   }
   239   echo '<p>All done!</p>';
   252   echo '<p>All done!</p>';
   240 }
   253 }
   241 else
   254 else