+require_once INSTALLDIR.'/scripts/commandline.inc.php';
+
+function tableDefs()
+{
+ $schema = array();
+ require INSTALLDIR.'/db/core.php';
+ return $schema;
+}
+
+$schema = Schema::get();
+$schemaUpdater = new SchemaUpdater($schema);
+foreach (tableDefs() as $table => $def) {
+ $schemaUpdater->register($table, $def);
+}
+$schemaUpdater->checkSchema();
+
+if (have_option('x', 'extensions')) {
+ $ext = trim(get_option_value('x', 'extensions'));
+ $exts = explode(',', $ext);
+ foreach ($exts as $plugin) {
+ try {
+ addPlugin($plugin);
+ } catch (Exception $e) {
+ print $e->getMessage()."\n";
+ exit(1);
+ }
+ }
+}