|
|
@@ -130,27 +130,31 @@ void fastweb::module_manager::start()
|
|
|
{
|
|
|
|
|
|
m_lua_include_path += ";" + app()->config->website.dir + "/?.lua";
|
|
|
- m_lua_include_path += ";" + app()->config->scripts.module_dir + "/?.lua";
|
|
|
-
|
|
|
m_lua_include_cpath += ";" + app()->config->website.dir + "/?." + DLL_EXT;
|
|
|
- m_lua_include_cpath += ";" + app()->config->scripts.module_dir + "/?." + DLL_EXT;
|
|
|
+ for (const auto& module_dir : app()->config->scripts.module_dir)
|
|
|
+ {
|
|
|
+ m_lua_include_path += ";" + module_dir + "/?.lua";
|
|
|
+ m_lua_include_cpath += ";" + module_dir + "/?." + DLL_EXT;
|
|
|
+ }
|
|
|
}
|
|
|
// FastWeb管理器
|
|
|
{
|
|
|
- std::string search_path = app()->config->scripts.module_dir + "/.install";
|
|
|
-
|
|
|
- std::map<std::string, bool> dirs;
|
|
|
- ylib::file::list(search_path, dirs);
|
|
|
- for_iter(iter, dirs)
|
|
|
+ for (const auto& module_dir : app()->config->scripts.module_dir)
|
|
|
{
|
|
|
- if (iter->second == false)
|
|
|
- continue;
|
|
|
- if (iter->first == "." || iter->first == "..")
|
|
|
- continue;
|
|
|
- m_lua_include_path += ";" + search_path + "/" + iter->first + "/?.lua";
|
|
|
- m_lua_include_cpath += ";" + search_path + "/" + iter->first + "/?." + DLL_EXT;
|
|
|
+ std::string search_path = module_dir + "/.install";
|
|
|
+
|
|
|
+ std::map<std::string, bool> dirs;
|
|
|
+ ylib::file::list(search_path, dirs);
|
|
|
+ for_iter(iter, dirs)
|
|
|
+ {
|
|
|
+ if (iter->second == false)
|
|
|
+ continue;
|
|
|
+ if (iter->first == "." || iter->first == "..")
|
|
|
+ continue;
|
|
|
+ m_lua_include_path += ";" + search_path + "/" + iter->first + "/?.lua";
|
|
|
+ m_lua_include_cpath += ";" + search_path + "/" + iter->first + "/?." + DLL_EXT;
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -257,20 +261,22 @@ std::vector<std::string> fastweb::module_manager::modules()
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- std::string search_path = app()->config->scripts.module_dir + "/.install";
|
|
|
-
|
|
|
- insert_dll_path(app()->config->scripts.module_dir);
|
|
|
-
|
|
|
- std::map<std::string, bool> dirs;
|
|
|
- ylib::file::list(search_path, dirs);
|
|
|
- for_iter(iter, dirs)
|
|
|
+ for (const auto& module_dir : app()->config->scripts.module_dir)
|
|
|
{
|
|
|
- if (iter->second == false)
|
|
|
- continue;
|
|
|
- if (iter->first == "." || iter->first == "..")
|
|
|
- continue;
|
|
|
+ insert_dll_path(module_dir);
|
|
|
+
|
|
|
+ std::string search_path = module_dir + "/.install";
|
|
|
+ std::map<std::string, bool> dirs;
|
|
|
+ ylib::file::list(search_path, dirs);
|
|
|
+ for_iter(iter, dirs)
|
|
|
+ {
|
|
|
+ if (iter->second == false)
|
|
|
+ continue;
|
|
|
+ if (iter->first == "." || iter->first == "..")
|
|
|
+ continue;
|
|
|
|
|
|
- insert_dll_path(search_path+"/"+iter->first);
|
|
|
+ insert_dll_path(search_path+"/"+iter->first);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// auto luas = ylib::file::traverse(app()->config->scripts.module_dir, "(.*\\.dll)");
|