Stop access to global vars. Not configurable.

After considering the interaction between ability to delcare globals in
scripts using the 'global' function, and the complexities related to
hanlding replication and AOF in a sane way with globals AND ability to
turn protection On and Off, we reconsidered the design. The new design
makes clear that there is only one good way to write Redis scripts, that
is not using globals. In the rare cases state must be retained across
calls a Redis key can be used.
This commit is contained in:
antirez
2012-04-13 13:26:59 +02:00
parent 6255a5ae66
commit 97cab30993
5 changed files with 4 additions and 57 deletions

View File

@ -585,7 +585,6 @@ struct redisServer {
int lua_timedout; /* True if we reached the time limit for script
execution. */
int lua_kill; /* Kill the script if true. */
int lua_protect_globals; /* If true globals must be declared */
/* Assert & bug reportign */
char *assert_failed;
char *assert_file;
@ -961,8 +960,6 @@ int *zunionInterGetKeys(struct redisCommand *cmd,robj **argv, int argc, int *num
/* Scripting */
void scriptingInit(void);
void scriptingEnableGlobalsProtection(lua_State *lua);
void scriptingDisableGlobalsProtection(lua_State *lua);
/* Git SHA1 */
char *redisGitSHA1(void);