Ghost/core/server/storage/index.js
Fabian Becker 2c3abeee03 Naming cleanup
closes #4069
- Rename everything from camelCase to lowercase + dashes
- Remove usage of `server`, `app` and `instance`
2014-09-20 21:09:16 +02:00

27 lines
743 B
JavaScript

var errors = require('../errors'),
storage = {};
function getStorage(storageChoice) {
// TODO: this is where the check for storage apps should go
// Local file system is the default. Fow now that is all we support.
storageChoice = 'local-file-store';
if (storage[storageChoice]) {
return storage[storageChoice];
}
try {
// TODO: determine if storage has all the necessary methods.
storage[storageChoice] = require('./' + storageChoice);
} catch (e) {
errors.logError(e);
}
// Instantiate and cache the storage module instance.
storage[storageChoice] = new storage[storageChoice]();
return storage[storageChoice];
}
module.exports.getStorage = getStorage;