Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Penambahan file dotEnv untuk pengaturan tambahan #147

Merged
5 commits merged into from
Oct 21, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
penambahan sample file env
  • Loading branch information
satujalur committed Oct 20, 2022
commit faeedfbc8fa8e76bb4ed27209999c2d9648a1e9b
12 changes: 6 additions & 6 deletions app/config/database.php
Original file line number Diff line number Diff line change
@@ -75,12 +75,12 @@

$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => '',
'password' => '',
'database' => '',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'hostname' => $_ENV['database.default.hostname'] ?? 'localhost',
'username' => $_ENV['database.default.username'] ?? 'root',
'password' => $_ENV['database.default.password'] ?? 'root',
'database' => $_ENV['database.default.database'] ?? 'db_ataslangit_sid',
'dbdriver' => $_ENV['database.default.DBDriver'] ?? 'mysqli',
'dbprefix' => $_ENV['database.default.DBPrefi'] ?? '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
14 changes: 14 additions & 0 deletions env
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#--------------------------------------------------------------------
# ENVIRONMENT
#--------------------------------------------------------------------

# CI_ENVIRONMENT = production

#--------------------------------------------------------------------
# DATABASE
#--------------------------------------------------------------------

# database.default.hostname = localhost
# database.default.database = db_ataslangit_sid
# database.default.username = root
# database.default.password = root
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
@@ -67,7 +67,7 @@
*
* NOTE: If you change these, also change the error_reporting() code below
*/
define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'production');
define('ENVIRONMENT', isset($_ENV['CI_ENVIRONMENT']) ? $_ENV['CI_ENVIRONMENT'] : 'production');

/*
*---------------------------------------------------------------