Changeset

3277:da0f55661e2b

mod_storage: Make DBI a soft dependency, not a hard one.
author Waqas Hussain <waqas20@gmail.com>
date Fri, 18 Jun 2010 14:22:17 +0500
parents 3276:4e44469b0583
children 3278:5ca2ed58788f
files plugins/storage/mod_storage.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/storage/mod_storage.lua	Fri Jun 18 14:20:00 2010 +0500
+++ b/plugins/storage/mod_storage.lua	Fri Jun 18 14:22:17 2010 +0500
@@ -5,7 +5,7 @@
 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(...)