function changeApplicationEnv($filePath, $newValue = 'development') { // Проверяем существование файла if (!file_exists($filePath)) { throw new Exception("Файл не найден: " . $filePath); }
// Записываем обратно в файл if (file_put_contents($filePath, $newContent) === false) { throw new Exception("Не удалось записать в файл: " . $filePath); }