• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Database-sample.php

#1
I just interesting in one question, sorry, if it's duplicate thread, but I can't find answer.

I can't understand, why CI don't have a file database-sample.php, like others frameworks. And file database.php must be in .gitignore by default, IMHO.  It's easy to have two file database-sample.php and database.php, so why not?
Reply

#2
What do understand a "database-sample.php" to contain?
"database.php" would normally be git-ignored because we expect it to hold database access credentials.
Reply

#3
For example, laravel has two files .env and .env.example, where .env contains real database credentials, email settings, etc and .env.example contains standard fake data only for sharing purposes. If I download a repository I can quickly setup project, using .env.example and then rename it to .env.
It's good approach in laravel, so I just ask what do you think about it
Reply

#4
Hmmm - isn't application/config/database.php pretty much what you described?
And the user guide (https://www.codeigniter.com/user_guide/d...ation.html) goes into more details.

As it is, you only need to create an environment-specific folder underneath aplicaiton/config, and copy then tailor any config files (eg database). You might have to make sure to git ignore them.

We have done this with CodeIgniter 4, with sample files to customize (.env, phpunit.xml.dit, Vagrantfile.dist), with the tailored files already git ignored.
Reply

#5
Codeigniter version 4 looks very and very promising. So wait for stable release Smile and thanks for all contributors for their work making the CI better
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.