<?php
include('public/legacy/config.php');
$c = $sugar_config['dbconfig'];
$str = "DATABASE_URL=\"mysql://{$c['db_user_name']}:{$c['db_password']}@localhost/{$c['db_name']}\"";
file_put_contents('.env.local', $str);
file_put_contents('index.php', "<?php header('location: public/'); ?>");