- local path = luci.util.libpath() .. "/controller/"
- local suff = { ".lua", ".lua.gz" }
-
- if luci.util.copcall(require, "luci.fastindex") then
- createindex_fastindex(path, suff)
- else
- createindex_plain(path, suff)
- end
-end
-
---- Generate the dispatching index using the fastindex C-indexer.
--- @param path Controller base directory
--- @param suffixes Controller file suffixes
-function createindex_fastindex(path, suffixes)
- index = {}
-
- if not fi then
- fi = luci.fastindex.new("index")
- for _, suffix in ipairs(suffixes) do
- fi.add(path .. "*" .. suffix)
- fi.add(path .. "*/*" .. suffix)
- end
- end
- fi.scan()