util/memcache.lua

changeset 0
73bc20975514
child 13
db66a09dc0b6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/util/memcache.lua	Sat Jul 31 16:09:11 2010 +0100
@@ -0,0 +1,26 @@
+
+module("memcache", package.seeall);
+
+function new()
+	local cache = {};
+	
+	local _data = {};
+	local _flags = {};
+	
+	function cache:set(key, flags, expires, data)
+		if expires ~= 0 then
+			return false, "Expiry is not currently implemented";
+		end
+		_flags[key] = flags;
+		_data[key] = data;
+		return true;
+	end
+	
+	function cache:get(key)
+		return _flags[key], _data[key];
+	end
+	
+	return cache;
+end
+
+return _M;

mercurial