Skip to content

Commit 6842399

Browse files
committed
don't export Redis by default
* use EXPORT_GLOBAL to control behaviour fix #68
1 parent 880dda9 commit 6842399

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/redis.lua

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ local redis = {
44
_COPYRIGHT = 'Copyright (C) 2009-2012 Daniele Alessandri',
55
}
66

7-
-- The following line is used for backwards compatibility in order to keep the `Redis`
8-
-- global module name. Using `Redis` is now deprecated so you should explicitly assign
9-
-- the module to a local variable when requiring it: `local redis = require('redis')`.
10-
Redis = redis
7+
if EXPORT_GLOBAL then
8+
-- The following line is used for backwards compatibility in order to keep the `Redis`
9+
-- global module name. Using `Redis` is now deprecated so you should explicitly assign
10+
-- the module to a local variable when requiring it: `local redis = require('redis')`.
11+
Redis = redis
12+
end
1113

1214
local unpack = _G.unpack or table.unpack
1315
local network, request, response = {}, {}, {}

0 commit comments

Comments
 (0)