MCPcopy
hub / github.com/thinkjs/thinkjs / loadAll

Method loadAll

lib/loader.js:100–119  ·  view source on GitHub ↗

* load all data

(type, isCli)

Source from the content-addressed store, hash-verified

98 * load all data
99 */
100 loadAll(type, isCli) {
101 this.initPath();
102 think.loader = new Loader(think.APP_PATH, thinkPath);
103
104 // write config to APP_PATH/runtime/config/[env].json file
105 const config = think.loader.loadConfig(think.app.env);
106 think.config = getConfigFn(config, think.loader.modules.length > 0);
107 think.logger = new Logger(helper.parseAdapterConfig(think.config('logger')), true);
108
109 if (type !== 'master') {
110 this.writeConfig(config);
111 this.loadExtend();
112 this.loadData();
113 this.loadMiddleware();
114 if (!isCli) {
115 this.loadCrontab();
116 }
117 }
118 think.loader.loadBootstrap(type);
119 }
120};
121
122module.exports = thinkLoader;

Callers 1

runMethod · 0.80

Calls 7

initPathMethod · 0.80
configMethod · 0.80
writeConfigMethod · 0.80
loadExtendMethod · 0.80
loadDataMethod · 0.80
loadMiddlewareMethod · 0.80
loadCrontabMethod · 0.80

Tested by

no test coverage detected