Fix reading .env file
This commit is contained in:
parent
12539d5f9d
commit
1e120d3ec7
@ -41,7 +41,7 @@ class SetupController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
$content = File::get('.env');
|
||||
$content = File::get('..' . DIRECTORY_SEPARATOR . '.env');
|
||||
$content = str_replace(
|
||||
'DB_CONNECTION = '.env('DB_CONNECTION'),
|
||||
'DB_CONNECTION = '.$request->input('type'),
|
||||
@ -77,7 +77,7 @@ class SetupController extends Controller
|
||||
'DB_PREFIX = '.$request->input('prefix'),
|
||||
$content
|
||||
);
|
||||
File::put('.env', $content);
|
||||
File::put('..' . DIRECTORY_SEPARATOR . '.env', $content);
|
||||
|
||||
return redirect('setup/info');
|
||||
}
|
||||
|
@ -59,8 +59,8 @@ class SetupControllerTest extends TestCase
|
||||
'password' => env('DB_PASSWORD'),
|
||||
'prefix' => '',
|
||||
];
|
||||
File::shouldReceive('get')->with('.env')->andReturn('');
|
||||
File::shouldReceive('put')->with('.env', '');
|
||||
File::shouldReceive('get')->with('..' . DIRECTORY_SEPARATOR . '.env')->andReturn('');
|
||||
File::shouldReceive('put')->with('..' . DIRECTORY_SEPARATOR . '.env', '');
|
||||
$this->post('/setup/database', $fake)->assertRedirect('/setup/info');
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user