This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/ext/upgrade/main.php
shish 434fab2dc5 and make the extensions match
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1003 7f39781d-f577-437e-ae19-be835c7a54ca
2008-08-23 12:08:19 +00:00

24 lines
481 B
PHP

<?php
class Upgrade implements Extension {
public function receive_event(Event $event) {
if($event instanceof InitExtEvent) {
$this->do_things();
}
}
private function do_things() {
global $config;
global $database;
if(!is_numeric($config->get_string("db_version"))) {
$config->set_int("db_version", 2);
}
if($config->get_int("db_version") < 6) {
$database->upgrade_schema("ext/upgrade/schema.xml");
}
}
}
add_event_listener(new Upgrade(), 5);
?>