2007-07-06 04:02:24 +00:00
|
|
|
<?php
|
|
|
|
|
2008-08-23 12:08:19 +00:00
|
|
|
class Upgrade implements Extension {
|
|
|
|
public function receive_event(Event $event) {
|
2008-08-22 09:41:30 +00:00
|
|
|
if($event instanceof InitExtEvent) {
|
2009-05-11 07:04:33 -07:00
|
|
|
$this->do_things();
|
2007-07-06 04:02:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-05-11 07:04:33 -07:00
|
|
|
private function do_things() {
|
|
|
|
global $config, $database;
|
2007-07-06 04:02:24 +00:00
|
|
|
|
|
|
|
if(!is_numeric($config->get_string("db_version"))) {
|
|
|
|
$config->set_int("db_version", 2);
|
|
|
|
}
|
2009-01-04 11:18:37 -08:00
|
|
|
|
2008-01-27 15:32:35 +00:00
|
|
|
if($config->get_int("db_version") < 6) {
|
2009-01-24 03:59:51 -08:00
|
|
|
// cry :S
|
|
|
|
}
|
|
|
|
|
|
|
|
if($config->get_int("db_version") < 6) { // 7
|
|
|
|
// add column image->locked
|
2007-09-29 22:48:33 +00:00
|
|
|
}
|
2007-07-06 04:02:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
add_event_listener(new Upgrade(), 5);
|
|
|
|
?>
|