You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/10/23 08:47:48 UTC
[GitHub] [apisix] RocFang opened a new issue #2506: [discuss] about localized require
RocFang opened a new issue #2506:
URL: https://github.com/apache/apisix/issues/2506
As we konw, In openresty we should localize require, and in apisix's lua scripts, the luacheck helps us do the checking.
But in some cases, like nginx.conf generated by template, there are global require, for example:
```
apisix = require("apisix")
```
Because they are in nginx.conf's xxx_by_lua_block, they can't be cecked by luacheck.
So, Is it nessesary to follow the lua code style in nginx.conf?
thanks.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] RocFang edited a comment on issue #2506: [discuss] about localized require
Posted by GitBox <gi...@apache.org>.
RocFang edited a comment on issue #2506:
URL: https://github.com/apache/apisix/issues/2506#issuecomment-715375086
@membphis maybe i did not express it clearly. my question is not about localize require,like local require = require,but the global variable apisix.
but of course i agrew that it's not a problem. thanks!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] membphis commented on issue #2506: [discuss] about localized require
Posted by GitBox <gi...@apache.org>.
membphis commented on issue #2506:
URL: https://github.com/apache/apisix/issues/2506#issuecomment-715359047
I only found those:
https://github.com/apache/apisix/blob/master/bin/apisix#L283-L284
In `init_by_lua_block` phase, it not a hot path, so we do not need localize `require`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] membphis closed issue #2506: [discuss] about localized require
Posted by GitBox <gi...@apache.org>.
membphis closed issue #2506:
URL: https://github.com/apache/apisix/issues/2506
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] RocFang commented on issue #2506: [discuss] about localized require
Posted by GitBox <gi...@apache.org>.
RocFang commented on issue #2506:
URL: https://github.com/apache/apisix/issues/2506#issuecomment-715375086
@membphis thanks. maybe i did not express it clearly. my question is not about localize require,like local require = require,but the global variable apisix.
but of course i agrew that it's not a problem. thabks.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] membphis commented on issue #2506: [discuss] about localized require
Posted by GitBox <gi...@apache.org>.
membphis commented on issue #2506:
URL: https://github.com/apache/apisix/issues/2506#issuecomment-715386633
for variable `apisix`, I think it is fine.
It is the right way.
Please feel free to reopen this issue if you still have questions about it.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org