From 5f24807aca8e3783ab17fb78533b9b13bea28cbb Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Fri, 30 May 2025 21:50:24 +0300 Subject: [PATCH] feat(install): Autofill `Host` in robots,txt file --- install.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/install.php b/install.php index b095c8bd5..ff88365d3 100644 --- a/install.php +++ b/install.php @@ -401,6 +401,14 @@ if (!empty($DB_HOST) && !empty($DB_DATABASE) && !empty($DB_USERNAME)) { $conn->close(); out("- Importing SQL dump completed!\n", 'success'); + // Autofill host in robots.txt + $robots_txt_file = BB_ROOT . 'robots.txt'; + if (isset($TP_HOST) && is_file($robots_txt_file)) { + $content = file_get_contents($robots_txt_file); + $content = str_replace('example.com', $TP_HOST, $content); + file_put_contents($robots_txt_file, $content); + } + if (isset($APP_ENV) && $APP_ENV === 'local') { if (!is_file(BB_ROOT . 'library/config.local.php')) { if (copy(BB_ROOT . 'library/config.php', BB_ROOT . 'library/config.local.php')) {