load(); } else { Dotenv::createMutable(base_path())->load(); } } App::loadAllConfig(['route']); $error_reporting = config('app.error_reporting'); if (isset($error_reporting)) { error_reporting($error_reporting); } $runtime_process_path = runtime_path() . DIRECTORY_SEPARATOR . '/windows'; if (!is_dir($runtime_process_path)) { mkdir($runtime_process_path); } $process_files = [ __DIR__ . DIRECTORY_SEPARATOR . 'start.php' ]; foreach (config('process', []) as $process_name => $config) { $process_files[] = write_process_file($runtime_process_path, $process_name, ''); } foreach (config('plugin', []) as $firm => $projects) { foreach ($projects as $name => $project) { if (!is_array($project)) { continue; } foreach ($project['process'] ?? [] as $process_name => $config) { $process_files[] = write_process_file($runtime_process_path, $process_name, "$firm.$name"); } } foreach ($projects['process'] ?? [] as $process_name => $config) { $process_files[] = write_process_file($runtime_process_path, $process_name, $firm); } } function write_process_file($runtime_process_path, $process_name, $firm) { $process_param = $firm ? "plugin.$firm.$process_name" : $process_name; $config_param = $firm ? "config('plugin.$firm.process')['$process_name']" : "config('process')['$process_name']"; $file_content = <<checkAllFilesChange()) { $status = proc_get_status($resource); $pid = $status['pid']; shell_exec("taskkill /F /T /PID $pid"); proc_close($resource); $resource = popen_processes($process_files); } }