Changeset 2566:9bf417837888 for inc/dbschema/upgrade.php
- Timestamp:
- 11/17/13 20:25:53 (12 years ago)
- Branch:
- 2.6
- Children:
- 2567:6c11245cbf04, 2568:61c67a7d17fa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/dbschema/upgrade.php
r2319 r2566 16 16 $cleanup_sessions = false; // update it in a step that needed sessions to be removed 17 17 $version = $core->getVersion('core'); 18 18 19 19 if ($version === null) { 20 20 return false; 21 21 } 22 22 23 23 if (version_compare($version,DC_VERSION,'<') == 1 || strpos(DC_VERSION,'dev')) 24 24 { … … 28 28 throw new Exception(__('SQLite Database Schema cannot be upgraded.')); 29 29 } 30 30 31 31 # Database upgrade 32 32 $_s = new dbStruct($core->con,$core->prefix); 33 33 require dirname(__FILE__).'/db-schema.php'; 34 34 35 35 $si = new dbStruct($core->con,$core->prefix); 36 36 $changes = $si->synchronize($_s); 37 37 38 38 /* Some other upgrades 39 39 ------------------------------------ */ … … 49 49 } 50 50 } 51 51 52 52 if (version_compare($version,'2.0-beta7.3','<')) 53 53 { … … 61 61 $core->con->execute(sprintf($strReq,'default','blowup')); 62 62 } 63 63 64 64 if (version_compare($version,'2.1-alpha2-r2383','<')) 65 65 { 66 66 $schema = dbSchema::init($core->con); 67 67 $schema->dropUnique($core->prefix.'category',$core->prefix.'uk_cat_title'); 68 68 69 69 # Reindex categories 70 70 $rs = $core->con->select( … … 87 87 } 88 88 } 89 89 90 90 if (version_compare($version,'2.1.6','<=')) 91 91 { … … 117 117 } 118 118 } 119 119 120 120 if (version_compare($version,'2.2-alpha1-r3043','<')) 121 121 { … … 125 125 $core->plugins->deleteModule('metadata'); 126 126 } 127 127 128 128 # Tags template class has been renamed 129 129 $sqlstr = … … 175 175 $count++; 176 176 } 177 177 178 178 # A bit of housecleaning for no longer needed files 179 179 $remfiles = array ( … … 272 272 'themes/default/tpl' 273 273 ); 274 274 275 275 foreach ($remfiles as $f) { 276 276 @unlink(DC_ROOT.'/'.$f); … … 280 280 } 281 281 } 282 282 283 283 if (version_compare($version,'2.3.1','<')) 284 284 { … … 385 385 if ($rs->f(0)==0) { 386 386 $strReq = sprintf($strReqFormat,'date_formats',serialize($date_formats),'Date formats examples'); 387 $core->con->execute($strReq); 387 $core->con->execute($strReq); 388 388 } 389 389 $rs = $core->con->select(sprintf($strReqSelect,'time_formats')); … … 397 397 if ($rs->f(0)==0) { 398 398 $strReq = sprintf($strReqFormat,'store_plugin_url','http://update.dotaddict.org/dc2/plugins.xml','Plugins XML feed location'); 399 $core->con->execute($strReq); 399 $core->con->execute($strReq); 400 400 } 401 401 $rs = $core->con->select(sprintf($strReqSelect,'store_theme_url')); 402 402 if ($rs->f(0)==0) { 403 403 $strReq = sprintf($strReqFormat,'store_theme_url','http://update.dotaddict.org/dc2/themes.xml','Themes XML feed location'); 404 $core->con->execute($strReq); 405 } 406 } 407 404 $core->con->execute($strReq); 405 } 406 } 407 408 408 $core->setVersion('core',DC_VERSION); 409 409 $core->blogDefaults(); 410 410 411 411 # Drop content from session table if changes or if needed 412 412 if ($changes != 0 || $cleanup_sessions) { 413 413 $core->con->execute('DELETE FROM '.$core->prefix.'session '); 414 414 } 415 415 416 416 # Empty templates cache directory 417 417 try { 418 418 $core->emptyTemplatesCache(); 419 419 } catch (Exception $e) {} 420 420 421 421 return $changes; 422 422 } … … 427 427 } 428 428 } 429 429 430 430 # No upgrade? 431 431 return false; 432 432 } 433 ?>
Note: See TracChangeset
for help on using the changeset viewer.