Rev 360 | Rev 489 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 360 | Rev 386 | ||
---|---|---|---|
Line 118... | Line 118... | ||
118 | $version = $row['value']; |
118 | $version = $row['value']; |
119 | if (!is_numeric($version) || ($version < 200) || ($version > 999)) { |
119 | if (!is_numeric($version) || ($version < 200) || ($version > 999)) { |
120 | throw new OIDplusConfigInitializationException(_L('Entry "database_version" inside the table "###config" seems to be wrong (expect number between 200 and 999)')); |
120 | throw new OIDplusConfigInitializationException(_L('Entry "database_version" inside the table "###config" seems to be wrong (expect number between 200 and 999)')); |
121 | } |
121 | } |
122 | 122 | ||
123 | while (file_exists($file = OIDplus::basePath().'/includes/db_updates/update'.$version.'.inc.php')) { |
123 | $update_files = glob(OIDplus::basePath().'/includes/db_updates/update*.inc.php'); |
- | 124 | foreach ($update_files as $update_file) { |
|
- | 125 | include_once $update_file; |
|
- | 126 | } |
|
- | 127 | while (function_exists($function_name = "oidplus_dbupdate_".$version."_".($version+1))) { |
|
124 | $prev_version = $version; |
128 | $prev_version = $version; |
125 | include $file; // run update-script |
129 | $function_name($this, $version); |
126 | if ($version != $prev_version+1) { |
130 | if ($version != $prev_version+1) { |
127 | // This should usually not happen, since the update-file should increase the version |
131 | // This should usually not happen, since the update-file should increase the version |
128 | // or throw an Exception by itself |
132 | // or throw an Exception by itself |
129 | throw new OIDplusException(_L('Database update %1 -> %2 failed (script reports new version to be %3)',$prev_version,$prev_version+1,$version)); |
133 | throw new OIDplusException(_L('Database update %1 -> %2 failed (script reports new version to be %3)',$prev_version,$prev_version+1,$version)); |
130 | } |
134 | } |