* load all data
(type, isCli)
| 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 | |
| 122 | module.exports = thinkLoader; |
no test coverage detected