Skip to content

Commit

Permalink
don't export Redis by default
Browse files Browse the repository at this point in the history
* use EXPORT_GLOBAL to control behaviour

fix nrk#68
  • Loading branch information
linuxmaniac committed Jan 24, 2020
1 parent 880dda9 commit 6842399
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/redis.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ local redis = {
_COPYRIGHT = 'Copyright (C) 2009-2012 Daniele Alessandri',
}

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

local unpack = _G.unpack or table.unpack
local network, request, response = {}, {}, {}
Expand Down

0 comments on commit 6842399

Please sign in to comment.