From 9cab19bb05478782752bf4fa9322c51af53c88dc Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Fri, 18 Jun 2010 14:22:17 +0500 Subject: mod_storage: Make DBI a soft dependency, not a hard one. --- plugins/storage/mod_storage.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/storage/mod_storage.lua b/plugins/storage/mod_storage.lua index e22de82c..e9f5f923 100644 --- a/plugins/storage/mod_storage.lua +++ b/plugins/storage/mod_storage.lua @@ -5,7 +5,7 @@ local cache = { data = {} }; function cache:get(key) return self.data[key]; end function cache:set(key, val) self.data[key] = val; return val; end -local DBI = require "DBI"; +local _,DBI = pcall(require, "DBI"); function get_database(driver, db, ...) local uri = "dbi:"..driver..":"..db; return cache:get(uri) or cache:set(uri, (function(...) -- cgit v1.2.3