Skip to content
Snippets Groups Projects
Commit c0262c7e authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire:
Browse files

Add disable-database-url.php

parent 67c94f89
No related branches found
No related tags found
No related merge requests found
Pipeline #73411 passed
#!/usr/bin/env php
<?php
//########################################################################################################
// Disables the DATABASE_URL env variable in `.env` when its default value is used to prevent confusion.
//########################################################################################################
// read the entire string
$str = file_get_contents('.env');
$pattern = '/^(DATABASE_URL=\"postgresql:\/\/symfony:ChangeMe@127.0.0.1:5432\/app)/im';
$replacement = '# $1';
$str = preg_replace($pattern, $replacement, $str);
// write the entire string
file_put_contents('.env', $str);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment