moving the db require to where it is actually needed

v1.18.x
Julian Lam 11 years ago
parent 5daf89f263
commit 2c1978218c

@ -8,7 +8,6 @@ var async = require('async'),
winston = require('winston'),
nconf = require('nconf'),
utils = require('../public/src/utils.js'),
db = require('./database.js'),
install = {
questions: [{
@ -329,7 +328,8 @@ var async = require('async'),
},
function (next) {
// Default plugins
var Plugins = require('./plugins');
var Plugins = require('./plugins'),
db = require('./database.js');
winston.info('Enabling default plugins');
@ -350,7 +350,11 @@ var async = require('async'),
}, next);
},
function (next) {
db.setObjectField('widgets:global', 'footer', "[{\"widget\":\"html\",\"data\":{\"html\":\"<footer id=\\\"footer\\\" class=\\\"container footer\\\">\\r\\n\\t<div class=\\\"copyright\\\">\\r\\n\\t\\tCopyright © 2014 <a target=\\\"_blank\\\" href=\\\"https://www.nodebb.com\\\">NodeBB Forums</a> | <a target=\\\"_blank\\\" href=\\\"//github.com/designcreateplay/NodeBB/graphs/contributors\\\">Contributors</a>\\r\\n\\t</div>\\r\\n</footer>\",\"title\":\"\",\"container\":\"\"}}]", next);
var db = require('./src/database').init(function(err) {
if (!err) {
db.setObjectField('widgets:global', 'footer', "[{\"widget\":\"html\",\"data\":{\"html\":\"<footer id=\\\"footer\\\" class=\\\"container footer\\\">\\r\\n\\t<div class=\\\"copyright\\\">\\r\\n\\t\\tCopyright © 2014 <a target=\\\"_blank\\\" href=\\\"https://www.nodebb.com\\\">NodeBB Forums</a> | <a target=\\\"_blank\\\" href=\\\"//github.com/designcreateplay/NodeBB/graphs/contributors\\\">Contributors</a>\\r\\n\\t</div>\\r\\n</footer>\",\"title\":\"\",\"container\":\"\"}}]", next);
}
});
},
function (next) {
require('./upgrade').upgrade(next);

Loading…
Cancel
Save